@@ -18,60 +18,47 @@ jobs:
18
18
deepsource :
19
19
name : Test and submit
20
20
runs-on : ubuntu-22.04
21
+ defaults :
22
+ run :
23
+ shell : bash
21
24
steps :
22
25
# The checkout must be the PR 'head' sha for deepsource to work
23
26
- name : Checkout PR
24
27
if : ${{ github.event_name == 'pull_request' }}
25
- uses : actions/checkout@v3
28
+ uses : actions/checkout@v4
26
29
with :
27
30
ref : ${{ github.event.pull_request.head.sha }}
28
31
29
32
- name : Checkout PUSH
30
33
if : ${{ github.event_name == 'push' }}
31
- uses : actions/checkout@v3
34
+ uses : actions/checkout@v4
32
35
33
- - uses : actions-rs/toolchain@v1
36
+ - name : Install Rust nightly
37
+ uses : dtolnay/rust-toolchain@nightly
34
38
with :
35
39
toolchain : nightly
36
- components : rustfmt
40
+ components : llvm-tools-preview, rustfmt
37
41
38
- - uses : actions/cache@v3
42
+ - name : Install cargo-llvm-cov
43
+ uses : taiki-e/install-action@v2
39
44
with :
40
- path : |
41
- ~/.cargo/bin/
42
- ~/.cargo/registry/index/
43
- ~/.cargo/registry/cache/
44
- ~/.cargo/git/db/
45
- ~/.cargo/advisory-dbs/
46
- key : ${{ runner.os }}-coverage-${{ hashFiles('**/Cargo.lock') }}
47
- restore-keys : |
48
- ${{ runner.os }}-coverage
45
+ tool : cargo-llvm-cov
49
46
50
- # coverage needs a nightly toolchain
51
- - name : Run test suite
52
- run : |
53
- rustup toolchain install nightly --allow-downgrade
54
- cargo +nightly test --all-features --no-fail-fast ||:
55
- env :
56
- CARGO_INCREMENTAL : " 0"
57
- RUSTFLAGS : " -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=unwind"
58
- RUSTDOCFLAGS : " -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=unwind"
59
-
60
- - name : Install grcov
47
+ - name : Setup postgres on Linux
48
+ # Postgresql setup adapted from Diesel CI
49
+ # Disable ssl as server doesn't have a trusted cert
50
+ if : runner.os == 'Linux'
61
51
run : |
62
- cargo +stable install grcov || true
52
+ sudo apt-get update
53
+ sudo apt-get install -y postgresql
54
+ sudo sed -i "s/scram-sha-256/trust/" /etc/postgresql/14/main/pg_hba.conf
55
+ sudo cat /etc/postgresql/14/main/pg_hba.conf
56
+ sudo service postgresql restart && sleep 3
57
+ echo BUTANE_PG_CONNSTR="host=localhost user=postgres sslmode=disable port=5432" >> $GITHUB_ENV
63
58
64
- - name : Run coverage
65
- id : coverage
66
- uses :
actions-rs/[email protected]
67
- with :
68
- config : .grcov.yaml
69
-
70
- # DeepSource limits the size of the coverage data file to 50 MB
71
- - name : Move coverage file
59
+ - name : Run test suite
72
60
run : |
73
- mv ${{ steps.coverage.outputs.report }} ./coverage.xml
74
- ls -al ./coverage.xml
61
+ cargo +nightly llvm-cov test --cobertura --output-path coverage.xml --branch --workspace --no-fail-fast --all-features
75
62
76
63
- name : Install deepsource cli
77
64
run : |
0 commit comments