-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from cuviper/ci
ci: merge queue and registry caching
- Loading branch information
Showing
5 changed files
with
53 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- staging | ||
- trying | ||
on: merge_group | ||
|
||
jobs: | ||
|
||
|
@@ -14,7 +10,12 @@ jobs: | |
matrix: | ||
rust: [1.56.0, stable, beta, nightly] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- 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 }} | ||
|
@@ -26,7 +27,7 @@ jobs: | |
name: No Std | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
target: thumbv6m-none-eabi | ||
|
@@ -38,8 +39,23 @@ jobs: | |
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
with: | ||
components: rustfmt | ||
- run: cargo fmt --all --check | ||
|
||
# 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, no_std, fmt] | ||
# 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: | ||
# 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) }}' |
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 |
---|---|---|
|
@@ -11,7 +11,12 @@ jobs: | |
matrix: | ||
rust: [1.56.0, stable] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- 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 }} | ||
|
@@ -22,8 +27,23 @@ jobs: | |
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
with: | ||
components: rustfmt | ||
- run: cargo fmt --all --check | ||
|
||
# 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] | ||
# 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: | ||
# 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) }}' |
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