mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 13:58:55 +08:00 
			
		
		
		
	Use grcov for code coverage
				
					
				
			This commit is contained in:
		
							
								
								
									
										43
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										43
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							| @@ -198,15 +198,38 @@ jobs: | |||||||
|     name: Generate code coverage |     name: Generate code coverage | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v3 | ||||||
|       - uses: hecrj/setup-rust-action@v1 |       - uses: dtolnay/rust-toolchain@stable | ||||||
|       # TODO: we don't use caching here because it's unclear if it will cause |  | ||||||
|       # the coverage to get less accurate (this is the case for some coverage |  | ||||||
|       # tools, although possibly not tarpaulin?) |  | ||||||
|       - name: Run cargo-tarpaulin |  | ||||||
|         uses: actions-rs/tarpaulin@v0.1 |  | ||||||
|         with: |         with: | ||||||
|           args: '--features "bundled-full session buildtime_bindgen"' |           components: 'llvm-tools-preview' | ||||||
|  |       - uses: taiki-e/install-action@main | ||||||
|  |         with: | ||||||
|  |           tool: grcov | ||||||
|  |       - name: Run tests for coverage | ||||||
|  |         run: | | ||||||
|  |           cargo test --verbose | ||||||
|  |           cargo test --features="bundled-full" --verbose | ||||||
|  |           cargo test --features="bundled-full session buildtime_bindgen" --verbose | ||||||
|  |           cargo test --features="bundled-sqlcipher-vendored-openssl" --verbose | ||||||
|  |         env: | ||||||
|  |           RUSTFLAGS: -Cinstrument-coverage | ||||||
|  |           RUSTDOCFLAGS: -Cinstrument-coverage | ||||||
|  |           LLVM_PROFILE_FILE: rusqlite-%p-%m.profraw | ||||||
|  |       - name: Produce coverage info | ||||||
|  |         run: | | ||||||
|  |           grcov $(find . -name "rusqlite-*.profraw" -print) \ | ||||||
|  |             -s . \ | ||||||
|  |             --branch \ | ||||||
|  |             --ignore-not-existing \ | ||||||
|  |             --ignore='target/*' \ | ||||||
|  |             --ignore='benches/*' \ | ||||||
|  |             --ignore='/*' \ | ||||||
|  |             --binary-path ./target/debug/ \ | ||||||
|  |             --excl-line='#\[derive' \ | ||||||
|  |             -t lcov \ | ||||||
|  |             -o lcov.info | ||||||
|       - name: Upload to codecov.io |       - name: Upload to codecov.io | ||||||
|         uses: codecov/codecov-action@v1 |         uses: codecov/codecov-action@v3 | ||||||
|  |         with: | ||||||
|  |           files: lcov.info | ||||||
|  |           fail_ci_if_error: true | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user