Add CI workflows #5
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: main | |
merge_group: | |
permissions: {} | |
jobs: | |
test-msrv-required: | |
name: Test ${{ matrix.state }} on ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
target: | |
- Linux | |
state: | |
- default | |
- NU7 | |
include: | |
- target: Linux | |
os: ubuntu-latest | |
- state: NU7 | |
rustflags: '--cfg zcash_unstable="nu7"' | |
env: | |
RUSTFLAGS: ${{ matrix.rustflags }} | |
RUSTDOCFLAGS: ${{ matrix.rustflags }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Run tests | |
run: > | |
cargo test | |
--workspace | |
- name: Verify working directory is clean | |
run: git diff --exit-code | |
test-msrv: | |
name: Test ${{ matrix.state }} on ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
strategy: | |
matrix: | |
target: | |
- macOS | |
- Windows | |
state: | |
- default | |
- NU7 | |
include: | |
- target: macOS | |
os: macOS-latest | |
- target: Windows | |
os: windows-latest | |
- state: NU7 | |
rustflags: '--cfg zcash_unstable="nu7"' | |
exclude: | |
- target: macOS | |
state: NU7 | |
env: | |
RUSTFLAGS: ${{ matrix.rustflags }} | |
RUSTDOCFLAGS: ${{ matrix.rustflags }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Run tests | |
run: > | |
cargo test | |
--workspace | |
- name: Verify working directory is clean | |
run: git diff --exit-code | |
build-latest: | |
name: Latest build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
- run: rustup override set ${RUST_TOOLCHAIN} | |
shell: bash | |
env: | |
RUST_TOOLCHAIN: ${{steps.toolchain.outputs.name}} | |
- name: Remove lockfile to build with latest dependencies | |
run: rm Cargo.lock | |
- name: Build crates | |
run: > | |
cargo build | |
--workspace | |
--all-targets | |
- name: Verify working directory is clean (excluding lockfile) | |
run: git diff --exit-code ':!Cargo.lock' | |
required-checks: | |
name: Required status checks have passed | |
needs: | |
- test-msrv-required | |
- build-latest | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Determine whether all required-pass steps succeeded | |
run: | | |
echo '${{ toJSON(needs) }}' | jq -e '[ .[] | .result == "success" ] | all' |