Cache llvm-cov tool (#34)
#87
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
| name: Coverage (Push) | |
| on: | |
| push: | |
| branches: ['**'] # all branches, including main | |
| permissions: | |
| contents: read | |
| actions: write | |
| jobs: | |
| coverage-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache llvm-cov build | |
| id: cache-llvm-cov | |
| uses: actions/cache@v4 | |
| continue-on-error: false | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - run: which cargo-llvm-cov || cargo install cargo-llvm-cov | |
| - run: rustup component add llvm-tools-preview | |
| - run: cargo llvm-cov --workspace --lcov --output-path lcov.info --ignore-filename-regex '^examples/' | |
| - name: Upload branch coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-lcov | |
| path: lcov.info | |
| retention-days: 21 |