9999 RPC_ENDPOINT_MAINNET : ${{ secrets.JUNO_ENDPOINT_MAINNET }}
100100 MLIR_SYS_170_PREFIX : /usr/lib/llvm-17/
101101 TABLEGEN_170_PREFIX : /usr/lib/llvm-17/
102+ TEST_COLLECT_COVERAGE : 1
102103 strategy :
103104 fail-fast : false
104105 matrix :
@@ -162,6 +163,13 @@ jobs:
162163 - name : Run tests (${{ matrix.target }})
163164 run : make ${{ matrix.target }}
164165
166+ - name : Save coverage report
167+ if : steps.restore-report.outputs.cache-hit != 'true' && ${{ matrix.target }} != 'test-doctest'
168+ uses : actions/cache/save@v3
169+ with :
170+ path : lcov-${{ matrix.target }}.info
171+ key : coverage-cache-${{ github.sha }}-${{ matrix.target }}
172+
165173 coverage :
166174 name : Generate and upload coverage report
167175 runs-on : ubuntu-latest
@@ -171,48 +179,30 @@ jobs:
171179 - name : Checkout
172180 uses : actions/checkout@v3
173181
174- - name : Install Rust nightly
175- uses : dtolnay/rust-toolchain@master
176- with :
177- toolchain : nightly
178-
179- - uses : Swatinem/rust-cache@v2
180- with :
181- cache-on-failure : true
182-
183- - name : Cache coverage report
182+ - name : Fetch coverage report for test-cairo-1
184183 id : restore-report
185184 uses : actions/cache/restore@v3
186185 with :
187- path : lcov.info
188- key : coverage-cache-${{ github.sha }}
186+ path : lcov-test-cairo-1 .info
187+ key : coverage-cache-${{ github.sha }}-test-cairo-1
189188
190- - name : Python3 Build
191- uses : actions/setup-python@v4
192- with :
193- python-version : ' 3.9'
194- cache : ' pip'
195- - uses : Swatinem/rust-cache@v2
189+ - name : Fetch coverage report for test-cairo-2
190+ id : restore-report
191+ uses : actions/cache/restore@v3
196192 with :
197- cache-on-failure : true
198-
199- - name : Install deps
200- run : make deps
193+ path : lcov-test-cairo-2.info
194+ key : coverage-cache-${{ github.sha }}-test-cairo-2
201195
202- - name : Generate coverage report
203- if : steps.restore-report.outputs.cache-hit != 'true'
204- run : make coverage-report
205-
206- - name : Save coverage report
207- if : steps.restore-report.outputs.cache-hit != 'true'
208- uses : actions/cache/save@v3
196+ - name : Fetch coverage report for test-cairo-native
197+ id : restore-report
198+ uses : actions/cache/restore@v3
209199 with :
210- path : lcov.info
211- key : coverage-cache-${{ github.sha }}
200+ path : lcov-test-cairo-native .info
201+ key : coverage-cache-${{ github.sha }}-test-cairo-native
212202
213203 - name : Upload coverage to codecov.io
214204 uses : codecov/codecov-action@v3
215205 with :
216206 fail_ci_if_error : true
217207 token : ${{ secrets.CODECOV_TOKEN }}
218- files : lcov.info
208+ files : lcov-test-cairo-1.info lcov-test-cairo-2.info lcov-test-cairo-native .info
0 commit comments