CI test improvements #2381
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| name: test | |
| jobs: | |
| test_with_codecov: | |
| 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 | |
| - 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: | |
| components: llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - 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 --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 }} | |
| files: ./coverage/reports/cobertura-${{ strategy.job-index }}.xml |