diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6e5cb2ff..4f37b93f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,8 +8,11 @@ name: test jobs: test_with_codecov: - name: Run tests with coverage reporting + name: Run tests coverage (Partition ${{ matrix.partition }}/${{ strategy.job-total }}) runs-on: ubuntu-latest + strategy: + matrix: + partition: [1,2,3,4,5,6,7,8,9,10,11,12,13,14] steps: - name: Checkout uses: actions/checkout@v4 @@ -17,6 +20,15 @@ jobs: - name: Install protobuf compiler run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: @@ -28,14 +40,23 @@ jobs: - name: Install cargo-nextest uses: taiki-e/install-action@nextest + - name: Setup nextest config + run: | + mkdir -p .config + cat <<'EOF' > .config/nextest.toml + [profile.default] + global-timeout = "1h" + slow-timeout = "3m" + EOF + - name: Run cargo-llvm-cov run: | mkdir -p ./coverage/reports/ - cargo llvm-cov nextest --lib --bins --tests --fail-fast --features integration-test --no-capture - cargo llvm-cov report --cobertura --output-path ./coverage/reports/cobertura.xml - + cargo llvm-cov nextest --lib --bins --tests --retries 1 --max-fail 3:immediate --partition hash:${{ matrix.partition }}/${{strategy.job-total}} --features integration-test --no-capture + cargo llvm-cov report --cobertura --output-path ./coverage/reports/cobertura-${{ strategy.job-index }}.xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage/reports/cobertura.xml + files: ./coverage/reports/cobertura-${{ strategy.job-index }}.xml \ No newline at end of file diff --git a/codecov.yaml b/codecov.yaml index f9108f89..2e2449a1 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -1,3 +1,8 @@ +codecov: + notify: + after_n_builds: 8 +comment: + after_n_builds: 8 coverage: status: project: