-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Reduce rust coverage report delay (#1370)
CI was running tests on `{MSRV, beta, nightly}` first, and only then running tests with coverage instrumentation on nightly. Since those tests are not on the critical path for the required checks, we can run the nightly tests directly with instrumentation on the first pass, shaving ~2mins from the commit-to-codecov report delay. I'm only doing this for rust, as the python tests _are_ in the required checks sets and we don't want to slow down those. drive-by: The python tests job had the same name as the linting job. --------- Co-authored-by: Douglas Wilson <[email protected]>
- Loading branch information
Showing
2 changed files
with
35 additions
and
32 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
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 |
---|---|---|
|
@@ -123,7 +123,9 @@ jobs: | |
strategy: | ||
fail-fast: true | ||
matrix: | ||
rust: ['1.75', beta, 'nightly'] | ||
# Stable is covered by `tests-stable-no-features` and `tests-stable-all-features` | ||
# Nightly is covered by `tests-nightly-coverage` | ||
rust: ['1.75', beta] | ||
name: tests (Rust ${{ matrix.rust }}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -143,37 +145,12 @@ jobs: | |
- name: Tests with all features | ||
run: cargo test --verbose --workspace --all-features | ||
|
||
# This is a meta job to mark successful completion of the required checks, | ||
# even if they are skipped due to no changes in the relevant files. | ||
required-checks: | ||
name: Required checks 🦀 | ||
needs: [changes, check, tests-stable-no-features, tests-stable-all-features] | ||
if: ${{ !cancelled() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fail if required checks failed | ||
# This condition should simply be `if: failure() || cancelled()`, | ||
# but there seems to be a bug in the github workflow runner. | ||
# | ||
# See https://github.com/orgs/community/discussions/80788 | ||
if: | | ||
needs.changes.result == 'failure' || needs.changes.result == 'cancelled' || | ||
needs.check.result == 'failure' || needs.check.result == 'cancelled' || | ||
needs.tests-stable-no-features.result == 'failure' || needs.tests-stable-no-features.result == 'cancelled' || | ||
needs.tests-stable-all-features.result == 'failure' || needs.tests-stable-all-features.result == 'cancelled' | ||
run: | | ||
echo "Required checks failed" | ||
echo "Please check the logs for more information" | ||
exit 1 | ||
- name: Pass if required checks passed | ||
run: | | ||
echo "All required checks passed" | ||
coverage: | ||
needs: [changes, tests-stable-no-features, tests-stable-all-features, tests-other, check] | ||
# Run only if there are changes in the relevant files and the check job passed or was skipped | ||
if: always() && !failure() && !cancelled() && needs.changes.outputs.rust == 'true' && github.event_name != 'merge_group' | ||
tests-nightly-coverage: | ||
needs: changes | ||
# Run only if there are changes in the relevant files | ||
if: ${{ needs.changes.outputs.rust == 'true' && github.event_name != 'merge_group' }} | ||
runs-on: ubuntu-latest | ||
name: tests (Rust nightly, coverage) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: mozilla-actions/[email protected] | ||
|
@@ -198,3 +175,29 @@ jobs: | |
name: rust | ||
flags: rust | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# This is a meta job to mark successful completion of the required checks, | ||
# even if they are skipped due to no changes in the relevant files. | ||
required-checks: | ||
name: Required checks 🦀 | ||
needs: [changes, check, tests-stable-no-features, tests-stable-all-features] | ||
if: ${{ !cancelled() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fail if required checks failed | ||
# This condition should simply be `if: failure() || cancelled()`, | ||
# but there seems to be a bug in the github workflow runner. | ||
# | ||
# See https://github.com/orgs/community/discussions/80788 | ||
if: | | ||
needs.changes.result == 'failure' || needs.changes.result == 'cancelled' || | ||
needs.check.result == 'failure' || needs.check.result == 'cancelled' || | ||
needs.tests-stable-no-features.result == 'failure' || needs.tests-stable-no-features.result == 'cancelled' || | ||
needs.tests-stable-all-features.result == 'failure' || needs.tests-stable-all-features.result == 'cancelled' | ||
run: | | ||
echo "Required checks failed" | ||
echo "Please check the logs for more information" | ||
exit 1 | ||
- name: Pass if required checks passed | ||
run: | | ||
echo "All required checks passed" |