ci: add cargo-tarpaulin coverage job
Swadhin Biswas committed 7 months ago
b36bd37
1 parent 2f13efe
commit b36bd37
1 file changed
+30 -0
Showing 1 changed file+30-0
▼.github/workflows/ci.yml
+30-0
| @@ -88,3 +88,33 @@ jobs: | ||
88 | 88 | |
89 | 89 | - name: Cache cargo registry & build |
90 | 90 | uses: actions/cache@v4 |
91 | + with: | |
92 | + path: | | |
93 | + ~/.cargo/registry | |
94 | + ~/.cargo/git | |
95 | + target | |
96 | + key: ${{ runner.os }}-cargo-cov-${{ hashFiles('**/Cargo.lock') }} | |
97 | + restore-keys: ${{ runner.os }}-cargo-cov- | |
98 | + | |
99 | + - name: Generate coverage | |
100 | + run: cargo tarpaulin --out xml --output-dir coverage --all-features --workspace --timeout 120 | |
101 | + | |
102 | + - name: Upload to Codecov | |
103 | + uses: codecov/codecov-action@v4 | |
104 | + with: | |
105 | + files: coverage/cobertura.xml | |
106 | + fail_ci_if_error: false | |
107 | + token: ${{ secrets.CODECOV_TOKEN }} | |
108 | + | |
109 | + # ── Build ──────────────────────────────────────────────────────────────────── | |
110 | + build: | |
111 | + name: Build (${{ matrix.os }}) | |
112 | + runs-on: ${{ matrix.os }} | |
113 | + strategy: | |
114 | + fail-fast: false | |
115 | + matrix: | |
116 | + os: [ubuntu-latest, macos-latest] | |
117 | + | |
118 | + steps: | |
119 | + - uses: actions/checkout@v4 | |
120 | + | |
91 | 121 | |