-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add macos target. Fix reusable_linux.yml Another fix for reusable_linux.yml Exclude macos-latest from more jobs. Separate macos files into a new yaml file. Don't double tap 'brew install pcre2'
- Loading branch information
Showing
6 changed files
with
112 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Reusable workflow for macos | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
target: | ||
required: true | ||
type: string | ||
arm: | ||
type: boolean | ||
default: false | ||
build_type: | ||
type: string | ||
default: 'debug' | ||
run_tests: | ||
type: boolean | ||
default: true | ||
|
||
env: | ||
ARM: ${{ inputs.arm }} | ||
TARGET: ${{ inputs.target }} | ||
BUILD_TYPE: ${{ inputs.build_type }} | ||
RELEASE_COMMIT: ${{ github.ref_type == 'tag' }} | ||
|
||
jobs: | ||
build_binary: | ||
name: rust-${{ matrix.rust }} (${{ inputs.build_type }}) | ||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
rust: [1.56.0, stable] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Install pcregrep | ||
run: | | ||
brew install pcre2 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: ${{ inputs.target }} | ||
override: true | ||
- name: Build binary (debug) | ||
if: ${{ inputs.build_type == 'debug' }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --target ${{ inputs.target }} | ||
- name: Build binary (release) | ||
if: ${{ inputs.build_type == 'release' }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --target ${{ inputs.target }} --release | ||
- name: Run test | ||
if: ${{ inputs.run_tests }} | ||
run: .github/workflows/run_test.sh | ||
|
||
- name: Prepare release artifact | ||
if: ${{ github.ref_type == 'tag' && matrix.rust == 'stable' }} | ||
run: | | ||
.github/workflows/prepare_artifact.sh | ||
- name: Upload for release | ||
id: upload_artifact | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ github.ref_type == 'tag' && matrix.rust == 'stable' }} | ||
with: | ||
name: upload-binary-artifact | ||
path: | | ||
rmate_${{ inputs.target }}.zip | ||
if-no-files-found: warn | ||
|
||
release_binary: | ||
name: Release rmate | ||
runs-on: ubuntu-latest | ||
needs: build_binary | ||
if: ${{ github.ref_type == 'tag' }} | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: upload-binary-artifact | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
fail_on_unmatched_files: false | ||
files: | | ||
rmate_${{ inputs.target }}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters