forked from rust-lang/crates.io
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.43 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Coverage
on:
push:
branches:
- coverage
- main
- master
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Test Coverage
runs-on: ubuntu-22.04
env:
RUST_BACKTRACE: 1
TEST_DATABASE_URL: postgres://postgres:postgres@localhost/cargo_registry_test
RUSTFLAGS: "-D warnings -Cinstrument-coverage"
MALLOC_CONF: "background_thread:true,abort_conf:true,abort:true,junk:true"
services:
postgres:
image: postgres:13@sha256:eee22204934b36935237e7c92355e3178cfdf3c5377dec9c19c848115cc4637b
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- run: cargo test --workspace
- run: rustup component add llvm-tools
- run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" --ignore "target/debug/build/**" -o target/coverage/tests.lcov
- uses: codecov/codecov-action@v3.1.4
with:
files: target/coverage/tests.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}