From a0f87a13fd34926bb31f9c2b38d6ad073103bfc6 Mon Sep 17 00:00:00 2001 From: Nolan Biscaro Date: Sat, 14 Jun 2025 18:07:18 +0000 Subject: [PATCH 1/3] add test analytics --- .config/nextest.toml | 2 ++ .github/workflows/ci.yml | 29 +++++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 000000000..76fd74b5d --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,2 @@ +[profile.ci.junit] +path = "junit.xml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d03d6cea..f72b5878f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: # ───────────────────────── 2 · TEST & COVERAGE ──────────────────────────── coverage: - name: Unit Tests + Coverage (llvm-cov) + name: Unit Tests + Coverage (llvm-cov + nextest) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -70,17 +70,26 @@ jobs: - uses: taiki-e/install-action@v2 with: { tool: cargo-llvm-cov } + - uses: taiki-e/install-action@v2 + with: { tool: nextest } - - name: Run tests and generate lcov.info + # ---------- Run the suite through nextest ---------- + - name: Run tests via llvm-cov/nextest + id: run_tests run: | - cargo llvm-cov --locked --lib \ - --lcov --output-path lcov.info - - - name: Upload to Codecov - uses: codecov/codecov-action@v5 + cargo llvm-cov \ + --locked \ + --lib \ + --lcov --output-path lcov.info \ + nextest \ + --profile ci \ + --no-fail-fast + + # ---------- Upload JUnit test results to Codecov ---------- + - name: Upload test results (JUnit) + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - files: lcov.info - verbose: true - fail_ci_if_error: true + files: target/nextest/ci/junit.xml From 1cb5343856f660e296d7999d698fe00bf5474783 Mon Sep 17 00:00:00 2001 From: Nolan Biscaro Date: Sat, 14 Jun 2025 18:11:35 +0000 Subject: [PATCH 2/3] fail ci on upload error --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f72b5878f..82ecdc1f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,3 +93,4 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: files: target/nextest/ci/junit.xml + fail_ci_if_error: true From ee3ced1faadb2bec7b17ab9ddd3e564e82c7d796 Mon Sep 17 00:00:00 2001 From: Nolan Biscaro Date: Sat, 14 Jun 2025 18:16:45 +0000 Subject: [PATCH 3/3] add back coverage report --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82ecdc1f4..b4cfc8064 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,3 +94,14 @@ jobs: with: files: target/nextest/ci/junit.xml fail_ci_if_error: true + + # ---------- Upload coverage report to Codecov ---------- + - name: Upload coverage (lcov) + if: ${{ !cancelled() }} + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: lcov.info + fail_ci_if_error: true +