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

ci: Improve times by splitting stable test runs #1072

Merged
merged 2 commits into from
May 17, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions .github/workflows/ci-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ jobs:
run: cargo bench --verbose --no-run --workspace --all-features

# Run tests on Rust stable
tests-stable:
tests-stable-no-features:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
runs-on: ubuntu-latest
name: tests (Rust stable)
name: tests (Rust stable, no features)
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
Expand All @@ -93,6 +93,22 @@ jobs:
run: cargo test --verbose --workspace --no-default-features --no-run
- name: Tests with no features
run: cargo test --verbose --workspace --no-default-features

# Run tests on Rust stable
tests-stable-all-features:
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
runs-on: ubuntu-latest
name: tests (Rust stable, all features)
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 'stable'
- name: Configure default rust toolchain
run: rustup override set ${{steps.toolchain.outputs.name}}
- name: Build with all features
run: cargo test --verbose --workspace --all-features --no-run
- name: Tests with all features
Expand Down Expand Up @@ -130,7 +146,7 @@ jobs:
# even if they are skipped due to no changes in the relevant files.
required-checks:
name: Required checks 🦀
needs: [changes, check, tests-stable]
needs: [changes, check, tests-stable-no-features, tests-stable-all-features]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
Expand All @@ -142,7 +158,8 @@ jobs:
if: |
needs.changes.result == 'failure' || needs.changes.result == 'cancelled' ||
needs.check.result == 'failure' || needs.check.result == 'cancelled' ||
needs.tests-stable.result == 'failure' || needs.tests-stable.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"
Expand All @@ -152,7 +169,7 @@ jobs:
echo "All required checks passed"

coverage:
needs: [changes, tests-stable, tests-other, check]
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'
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion hugr/src/hugr/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Hugr {

/// Validate extensions on the input and output edges of nodes. Check that
/// the target ends of edges require the extensions from the sources, and
/// check extension deltas from parent nodes are reflected in their children
/// check extension deltas from parent nodes are reflected in their children.
pub fn validate_extensions(&self, closure: ExtensionSolution) -> Result<(), ValidationError> {
let validator = ExtensionValidator::new(self, closure);
for src_node in self.nodes() {
Expand Down