Skip to content

Commit

Permalink
ci: Remove optional success (continue-on-error)
Browse files Browse the repository at this point in the history
Using "continue-on-error: true" on various steps of dev.yml's jobs may
hide build or test failures, as the job unconditionally returns true for
these steps. Let's remove these attributes.

If we want to allow these jobs to fail, we should simply avoid to mark
them as required. This means adjusting the repository settings (compared
to what we have currently) to not require the final "summary" step to
succeed, but individual jobs, based on their job matrix value. Let's add
job names to make it easier.

Signed-off-by: Quentin Monnet <[email protected]>
  • Loading branch information
qmonnet committed Nov 18, 2024
1 parent 1b58867 commit 02d7ce7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 33 deletions.
55 changes: 22 additions & 33 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ jobs:
fail-fast: false
matrix:
rust:
- toolchain: "stable"
optional: false
- toolchain: "beta"
optional: true
- toolchain: "nightly"
optional: true
continue-on-error: ${{ matrix.rust.optional }}
- "stable"
- "beta"
- "nightly"
name: "Developer build (Rust ${{ matrix.rust }})"
runs-on: "lab"
timeout-minutes: 45
steps:
Expand All @@ -83,7 +80,7 @@ jobs:
- name: "install rust"
uses: "dtolnay/rust-toolchain@stable"
with:
toolchain: "${{ matrix.rust.toolchain }}"
toolchain: "${{ matrix.rust }}"
targets: "x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl"
- name: "Checkout"
uses: "actions/checkout@v4"
Expand Down Expand Up @@ -113,49 +110,41 @@ jobs:
just --yes debug=true fake-nix
- run: |
just debug=true cargo +${{matrix.rust.toolchain}} build --locked --profile=dev --target=x86_64-unknown-linux-gnu
continue-on-error: ${{ matrix.rust.optional }}
- name: "tests: rust ${{ matrix.rust.toolchain }} profile=dev target=x86_64-unknown-linux-gnu"
just debug=true cargo +${{matrix.rust}} build --locked --profile=dev --target=x86_64-unknown-linux-gnu
- name: "tests: rust ${{ matrix.rust }} profile=dev target=x86_64-unknown-linux-gnu"
run: |
export GITHUB_STEP_SUMMARY
just debug=true rust=${{matrix.rust.toolchain}} profile=dev target=x86_64-unknown-linux-gnu test
just debug=true rust=${{matrix.rust.toolchain}} profile=dev target=x86_64-unknown-linux-gnu report
continue-on-error: ${{ matrix.rust.optional }}
just debug=true rust=${{matrix.rust}} profile=dev target=x86_64-unknown-linux-gnu test
just debug=true rust=${{matrix.rust}} profile=dev target=x86_64-unknown-linux-gnu report
- run: |
just cargo +${{matrix.rust.toolchain}} build --locked --profile=dev --target=x86_64-unknown-linux-musl
continue-on-error: ${{ matrix.rust.optional }}
- name: "tests: rust ${{ matrix.rust.toolchain }} profile=dev target=x86_64-unknown-linux-musl"
just cargo +${{matrix.rust}} build --locked --profile=dev --target=x86_64-unknown-linux-musl
- name: "tests: rust ${{ matrix.rust }} profile=dev target=x86_64-unknown-linux-musl"
run: |
export GITHUB_STEP_SUMMARY
just debug=true rust=${{matrix.rust.toolchain}} profile=dev target=x86_64-unknown-linux-musl test
just debug=true rust=${{matrix.rust.toolchain}} profile=dev target=x86_64-unknown-linux-musl report
continue-on-error: ${{ matrix.rust.optional }}
just debug=true rust=${{matrix.rust}} profile=dev target=x86_64-unknown-linux-musl test
just debug=true rust=${{matrix.rust}} profile=dev target=x86_64-unknown-linux-musl report
- run: |
just debug=true cargo +${{matrix.rust.toolchain}} build --locked --profile=release --target=x86_64-unknown-linux-gnu
continue-on-error: ${{ matrix.rust.optional }}
- name: "tests: rust ${{ matrix.rust.toolchain }} profile=release target=x86_64-unknown-linux-gnu"
just debug=true cargo +${{matrix.rust}} build --locked --profile=release --target=x86_64-unknown-linux-gnu
- name: "tests: rust ${{ matrix.rust }} profile=release target=x86_64-unknown-linux-gnu"
run: |
export GITHUB_STEP_SUMMARY
just debug=true rust=${{matrix.rust.toolchain}} profile=release target=x86_64-unknown-linux-gnu test
just debug=true rust=${{matrix.rust.toolchain}} profile=release target=x86_64-unknown-linux-gnu report
continue-on-error: ${{ matrix.rust.optional }}
just debug=true rust=${{matrix.rust}} profile=release target=x86_64-unknown-linux-gnu test
just debug=true rust=${{matrix.rust}} profile=release target=x86_64-unknown-linux-gnu report
- run: |
just debug=true cargo +${{matrix.rust.toolchain}} build --locked --profile=release --target=x86_64-unknown-linux-musl
continue-on-error: ${{ matrix.rust.optional }}
- name: "tests: rust ${{ matrix.rust.toolchain }} profile=release target=x86_64-unknown-linux-musl"
just debug=true cargo +${{matrix.rust}} build --locked --profile=release --target=x86_64-unknown-linux-musl
- name: "tests: rust ${{ matrix.rust }} profile=release target=x86_64-unknown-linux-musl"
run: |
export GITHUB_STEP_SUMMARY
just debug=true rust=${{matrix.rust.toolchain}} profile=release target=x86_64-unknown-linux-musl test
just debug=true rust=${{matrix.rust.toolchain}} profile=release target=x86_64-unknown-linux-musl report
continue-on-error: ${{ matrix.rust.optional }}
just debug=true rust=${{matrix.rust}} profile=release target=x86_64-unknown-linux-musl test
just debug=true rust=${{matrix.rust}} profile=release target=x86_64-unknown-linux-musl report
- uses: "actions/upload-artifact@v4"
if: ${{ always() }}
with:
name: "test-results-${{ matrix.rust.toolchain }}"
name: "test-results-${{ matrix.rust }}"
path: "target/nextest/"

- name: "Setup tmate session for debug"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sterile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
rust:
- "stable"
- "nightly"
name: "Sterile test run (Rust ${{ matrix.rust }})"
steps:
- name: "login to ghcr.io"
uses: "docker/login-action@v3"
Expand Down Expand Up @@ -178,6 +179,7 @@ jobs:
rust:
- "stable"
- "nightly"
name: "Push containers (Rust ${{ matrix.rust }})"
steps:
- name: "login to ghcr.io"
uses: "docker/login-action@v3"
Expand Down

0 comments on commit 02d7ce7

Please sign in to comment.