-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (46 loc) · 1.42 KB
/
server-code-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
52
53
name: Server test and code coverage
on:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nettuscheduler
ports:
- 5432:5432
env:
PORT: 5000
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/nettuscheduler
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
scheduler/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Generate code coverage
run: |
cd scheduler
# https://github.com/xd009642/tarpaulin/issues/756
cargo install cargo-tarpaulin --version 0.18.0-alpha3 || true
# run the migrations first
cargo install sqlx-cli --no-default-features --features postgres || true
(cd crates/infra && sqlx migrate run)
# cargo install cargo-tarpaulin
cargo tarpaulin --avoid-cfg-tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true