diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 000000000..1828761ba --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,18 @@ +# Nextest configuration +# https://nexte.st/docs/configuration/ + +[profile.default] +# Terminate a test if it runs longer than 60s, warning at 30s. +slow-timeout = { period = "30s", terminate-after = 2 } +# Show output for failing tests immediately. +failure-output = "immediate" +final-status-level = "flaky" + +[profile.ci] +# Don't stop at the first failure — surface everything in one run. +fail-fast = false +# Retry flaky tests a couple of times before marking them failed. +retries = 2 +# Emit JUnit XML for CI test reporting. +[profile.ci.junit] +path = "junit.xml" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 06d6e9407..484f42eef 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,5 +1,6 @@ permissions: contents: read + checks: write name: Build "on": @@ -51,6 +52,9 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + - name: Setup cache uses: Swatinem/rust-cache@v2 @@ -64,10 +68,29 @@ jobs: run: cargo build --verbose --all-features - name: Run tests (no features) - run: cargo test --verbose --no-default-features + run: cargo nextest run --profile ci --no-default-features - name: Run tests (default features) - run: cargo test --verbose + run: cargo nextest run --profile ci - name: Run tests (all features) - run: cargo test --verbose --all-features + run: cargo nextest run --profile ci --all-features + + - name: Run doctests (all features) + run: cargo test --doc --all-features + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: "junit-${{ matrix.os }}" + path: target/nextest/ci/junit.xml + if-no-files-found: ignore + + - name: Publish test report + if: always() + uses: mikepenz/action-junit-report@v5 + with: + report_paths: target/nextest/ci/junit.xml + check_name: "Test report (${{ matrix.os }})" + include_passed: false