Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More CI updates #308

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand Down Expand Up @@ -68,16 +73,17 @@ jobs:
components: rustfmt
- run: cargo fmt --all --check

ci-success:
name: Complete
runs-on: ubuntu-latest
needs: [test, i586, no_std, fmt]
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: [test, i586, no_std, fmt]
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) }}'
5 changes: 5 additions & 0 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
rust: [1.31.0, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
rust: [1.31.0, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand All @@ -28,16 +33,17 @@ jobs:
- uses: actions/checkout@v4
- run: cargo fmt --all --check

ci-success:
name: Complete
runs-on: ubuntu-latest
needs: [test, fmt]
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: [test, fmt]
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) }}'