@@ -18,60 +18,52 @@ jobs:
1818 deepsource :
1919 name : Test and submit
2020 runs-on : ubuntu-22.04
21+ defaults :
22+ run :
23+ shell : bash
2124 steps :
2225 # The checkout must be the PR 'head' sha for deepsource to work
2326 - name : Checkout PR
2427 if : ${{ github.event_name == 'pull_request' }}
25- uses : actions/checkout@v3
28+ uses : actions/checkout@v4
2629 with :
2730 ref : ${{ github.event.pull_request.head.sha }}
2831
2932 - name : Checkout PUSH
3033 if : ${{ github.event_name == 'push' }}
31- uses : actions/checkout@v3
34+ uses : actions/checkout@v4
3235
33- - uses : actions-rs/toolchain@v1
36+ - name : Install Rust stable with llvm-tools-preview
37+ uses :
actions-rust-lang/[email protected] 38+ with :
39+ components : llvm-tools-preview
40+
41+ - name : Install Rust nightly with rustfmt
42+ uses : actions-rs/toolchain@v1
3443 with :
3544 toolchain : nightly
3645 components : rustfmt
3746
38- - uses : actions/cache@v3
47+ - name : Install cargo-llvm-cov
48+ uses : taiki-e/install-action@v2
3949 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
49-
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"
50+ tool : cargo-llvm-cov
5951
60- - name : Install grcov
61- run : |
62- cargo +stable install grcov || true
52+ - name : Setup postgres on Linux
53+ # Postgresql setup adapted from Diesel CI
54+ # Disable ssl as server doesn't have a trusted cert
55+ if : runner.os == 'Linux'
56+ run : |
57+ sudo apt-get update
58+ sudo apt-get install -y postgresql
59+ sudo sed -i "s/scram-sha-256/trust/" /etc/postgresql/14/main/pg_hba.conf
60+ sudo cat /etc/postgresql/14/main/pg_hba.conf
61+ sudo service postgresql restart && sleep 3
62+ echo BUTANE_PG_CONNSTR="host=localhost user=postgres sslmode=disable port=5432" >> $GITHUB_ENV
6363
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
64+ - name : Run test suite
7265 run : |
73- mv ${{ steps.coverage.outputs.report }} ./coverage.xml
74- ls -al ./coverage.xml
66+ cargo llvm-cov test --cobertura --output-path coverage.xml --workspace --no-fail-fast --all-features
7567
7668 - name : Install deepsource cli
7769 run : |
0 commit comments