Minion: Use minion's build system not build.rs to build libminion, and CI tweaks #6
Workflow file for this run
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
# https://doc.rust-lang.org/cargo/guide/continuous-integration.html | |
# https://ectobit.com/blog/speed-up-github-actions-rust-pipelines/ | |
name: 'solvers/minion' | |
on: | |
push: | |
paths: | |
- 'solvers/minion/**' | |
pull_request: | |
paths: | |
- 'solvers/minion/**' | |
workflow_dispatch: | |
jobs: | |
ubuntu: | |
name: 'solvers/minion: Ubuntu Build' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# https://stackoverflow.com/questions/32327108/get-the-current-commit-id-of-specified-submodule | |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable | |
- name: Get minion hash for cache invalidation | |
id: minion-cache | |
run: | | |
echo "minion_sha=$(git rev-parse HEAD:solvers/minion/vendor)" >> "$GITHUB_OUTPUT" | |
- name: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
solvers/minion/vendor | |
key: ${{ runner.os }}-minion-${{ steps.minion-cache.outputs.minion_sha }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# match minion exactly, cargo inexactly | |
restore-keys: ${{ runner.os }}-minion-${{ steps.minion-cache.outputs.minion_sha}}-cargo- | |
- working-directory: ./solvers/minion | |
run: rustup update stable && rustup default stable | |
- working-directory: ./solvers/minion | |
run: cargo build -vv | |
mac: | |
name: 'solvers/minion: Mac Build' | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get minion hash for cache invalidation | |
id: minion-cache | |
run: | | |
echo "minion_sha=$(git rev-parse HEAD:solvers/minion/vendor)" >> "$GITHUB_OUTPUT" | |
- name: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
solvers/minion/vendor | |
key: ${{ runner.os }}-minion-${{ steps.minion-cache.outputs.minion_sha }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# match minion exactly, cargo inexactly | |
restore-keys: ${{ runner.os }}-minion-${{ steps.minion-cache.outputs.minion_sha}}-cargo- | |
- working-directory: ./solvers/minion | |
run: rustup update stable && rustup default stable | |
- working-directory: ./solvers/minion | |
run: rustup target add aarch64-apple-darwin | |
- working-directory: ./solvers/minion | |
run: cargo build -vv | |
tests: | |
name: 'solvers/minion: Tests' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# https://stackoverflow.com/questions/32327108/get-the-current-commit-id-of-specified-submodule | |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable | |
- name: Get minion hash for cache invalidation | |
id: minion-cache | |
run: | | |
echo "minion_sha=$(git rev-parse HEAD:solvers/minion/vendor)" >> "$GITHUB_OUTPUT" | |
- name: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
solvers/minion/vendor | |
key: ${{ runner.os }}-minion-${{ steps.minion-cache.outputs.minion_sha }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
# match minion exactly, cargo inexactly | |
restore-keys: ${{ runner.os }}-minion-${{ steps.minion-cache.outputs.minion_sha}}-cargo- | |
- working-directory: ./solvers/minion | |
run: rustup update stable && rustup default stable | |
- working-directory: ./solvers/minion | |
run: cargo test | |