-
-
Notifications
You must be signed in to change notification settings - Fork 216
79 lines (71 loc) · 2.37 KB
/
grcov.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Code coverage
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'demo/**'
- 'docs/**'
- 'homebrew-formula/**'
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- 'demo/**'
- 'docs/**'
- 'homebrew-formula/**'
workflow_dispatch:
jobs:
grcov:
runs-on: ubuntu-latest
env:
# PG_* variables are used by psql
PGDATABASE: test
PGHOST: localhost
PGUSER: postgres
services:
postgres:
image: postgis/postgis:14-3.3-alpine
env:
# POSTGRES_* variables are used by the postgis/postgres image
POSTGRES_DB: ${{ env.PGDATABASE }}
POSTGRES_USER: ${{ env.PGUSER }}
POSTGRES_HOST_AUTH_METHOD: trust
ports:
# will assign a random free host port
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup database
run: |
sudo apt-get install postgresql-client
tests/fixtures/initdb.sh
env:
PGPORT: ${{ job.services.postgres.ports[5432] }}
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
- name: Run tests
run: cargo test
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
DATABASE_URL: postgres://${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}
- name: Gather coverage data
id: coverage
uses: actions-rs/[email protected]
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
file: ${{ steps.coverage.outputs.report }}
- name: Check conditional cfg values
run: |
cargo +nightly check -Z unstable-options -Z check-cfg=features,names,values,output --workspace
env:
RUSTFLAGS: '-D warnings'