Skip to content

Commit

Permalink
Merge pull request #309 from cuviper/ci
Browse files Browse the repository at this point in the history
More CI updates
  • Loading branch information
cuviper authored Feb 6, 2024
2 parents 2044a2e + 2d8fdb8 commit 3ac86a4
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: matrix.rust == '1.63.0'
with:
path: ~/.cargo/registry/index
key: cargo-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand Down Expand Up @@ -67,6 +72,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: matrix.rust == '1.63.0'
with:
path: ~/.cargo/registry/index
key: cargo-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand Down Expand Up @@ -99,29 +109,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- uses: dtolnay/rust-toolchain@master
- uses: actions/cache@v4
with:
toolchain: 1.63.0 # MSRV
path: ~/.cargo/registry/index
key: cargo-git-index
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/[email protected] # MSRV
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z direct-minimal-versions
- name: Build
run: cargo build --verbose --all-features

ci-success:
name: Complete
runs-on: ubuntu-latest
needs: [tests, nostd_build, clippy, miri, minimal-versions]
steps:
- run: exit 0
ci-failed:
name: Complete
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [tests, nostd_build, clippy, miri, minimal-versions]
if: failure()
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
- run: exit 1
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 comments on commit 3ac86a4

Please sign in to comment.