9090 runs-on : ubuntu-latest
9191 steps :
9292 - uses : actions/checkout@v4
93+
94+ - name : Install cargo-llvm-cov
95+ uses : taiki-e/install-action@cargo-llvm-cov
96+
9397 - name : Start ClickHouse in Docker
9498 uses : hoverkraft-tech/compose-action@v2.2.0
9599 with :
@@ -98,10 +102,12 @@ jobs:
98102
99103 - run : rustup show active-toolchain -v
100104 # TODO: --workspace won't be required after splitting workspace and the main crate
101- - run : cargo test --workspace
102- - run : cargo test --workspace --no-default-features
103- - run : cargo test --workspace --features uuid,time
104- - run : cargo test --workspace --all-features
105+ - name : Run tests
106+ run : cargo llvm-cov test --workspace --no-report
107+ - name : Run tests without default features
108+ run : cargo llvm-cov test --workspace --no-report --no-default-features
109+ - name : Run tests with all features
110+ run : cargo llvm-cov test --workspace --no-report --all-features
105111
106112 - name : Run tests with ClickHouse Cloud
107113 env :
@@ -112,8 +118,18 @@ jobs:
112118 # Temporary runs tests with `cloud_` prefix only until we validate that the rest of the tests are working
113119 # `https_errors` should assert ClickHouse Cloud connection errors without enabled TLS features
114120 run : |
115- cargo test cloud_ --features rustls-tls -- --nocapture
116- cargo test https_errors -- --nocapture
121+ cargo llvm-cov test cloud_ --no-report --features rustls-tls -- --nocapture
122+ cargo llvm-cov test https_errors --no-report -- --nocapture
123+
124+ - name : Generate code coverage
125+ run : cargo llvm-cov report --codecov --output-path codecov.json
126+ - name : Upload coverage to Codecov
127+ uses : codecov/codecov-action@v5
128+ with :
129+ files : codecov.json
130+ token : ${{ secrets.CODECOV_TOKEN }}
131+ slug : ClickHouse/clickhouse-rs
132+ fail_ci_if_error : true
117133
118134 miri :
119135 needs : build
0 commit comments