@@ -8,15 +8,27 @@ name: test
88
99jobs :
1010 test_with_codecov :
11- name : Run tests with coverage reporting
11+ name : Run tests coverage (Partition ${{ matrix.partition }}/${{ strategy.job-total }})
1212 runs-on : ubuntu-latest
13+ strategy :
14+ matrix :
15+ partition : [1, 2, 3, 4, 5, 6, 7, 8]
1316 steps :
1417 - name : Checkout
1518 uses : actions/checkout@v4
1619
1720 - name : Install protobuf compiler
1821 run : sudo apt-get update && sudo apt-get install -y protobuf-compiler
1922
23+ - name : Cache
24+ uses : actions/cache@v4
25+ with :
26+ path : |
27+ ~/.cargo/registry
28+ ~/.cargo/git
29+ target
30+ key : ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
31+
2032 - name : Install Rust toolchain
2133 uses : dtolnay/rust-toolchain@stable
2234 with :
@@ -28,14 +40,23 @@ jobs:
2840 - name : Install cargo-nextest
2941 uses : taiki-e/install-action@nextest
3042
43+ - name : Setup nextest config
44+ run : |
45+ mkdir -p .config
46+ cat <<'EOF' > .config/nextest.toml
47+ [profile.default]
48+ global-timeout = "1h30m"
49+ slow-timeout = "3m"
50+ EOF
51+
3152 - name : Run cargo-llvm-cov
3253 run : |
3354 mkdir -p ./coverage/reports/
34- cargo llvm-cov nextest --lib --bins --tests --fail-fast --features integration-test --no-capture
35- cargo llvm-cov report --cobertura --output-path ./coverage/reports/cobertura.xml
36-
55+ 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
56+ cargo llvm-cov report --cobertura --output-path ./coverage/reports/cobertura-${{ strategy.job-index }} .xml
57+
3758 - name : Upload coverage to Codecov
3859 uses : codecov/codecov-action@v4
3960 with :
4061 token : ${{ secrets.CODECOV_TOKEN }}
41- file : ./coverage/reports/cobertura.xml
62+ files : ./coverage/reports/cobertura-${{ strategy.job-index }} .xml
0 commit comments