Skip to content

Commit 3b3fb81

Browse files
committed
actions: Update actions and configuration
1 parent b1b96e3 commit 3b3fb81

File tree

1 file changed

+43
-48
lines changed

1 file changed

+43
-48
lines changed

.github/workflows/json-structural-diff.yml

Lines changed: 43 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,66 @@ on:
88
branches:
99
- master
1010

11+
env:
12+
GRCOV_VERSION: "0.8.20"
13+
1114
jobs:
1215
clippy-rustfmt:
1316

1417
runs-on: ubuntu-latest
1518

1619
steps:
17-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
1821

1922
- name: Install stable
20-
uses: actions-rs/toolchain@v1
23+
uses: dtolnay/rust-toolchain@stable
2124
with:
22-
profile: minimal
23-
toolchain: stable
24-
override: true
25-
components: clippy, rustfmt
25+
components: rustfmt, clippy
2626

2727
- name: Run rustfmt
28-
uses: actions-rs/cargo@v1
29-
with:
30-
command: fmt
31-
args: -- --check --verbose
28+
run:
29+
cargo fmt --all -- --check --verbose
3230

3331
- name: Run cargo clippy
34-
uses: actions-rs/clippy-check@v1
35-
with:
36-
token: ${{ secrets.GITHUB_TOKEN }}
37-
args: --all-features -- -D warnings
32+
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
3833

3934
code-coverage:
4035

4136
runs-on: ubuntu-latest
4237

4338
steps:
44-
- uses: actions/checkout@v2
45-
46-
- uses: actions-rs/toolchain@v1
47-
with:
48-
toolchain: nightly
49-
override: true
50-
51-
- uses: actions-rs/cargo@v1
52-
with:
53-
command: test
54-
args: --all-features --no-fail-fast
55-
env:
56-
CARGO_INCREMENTAL: '0'
57-
RUSTFLAGS: >
58-
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code
59-
-Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests
60-
RUSTDOCFLAGS: >
61-
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code
62-
-Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests
63-
64-
- id: coverage
65-
uses: actions-rs/[email protected]
66-
67-
- name: Coveralls upload
68-
uses: coverallsapp/github-action@master
69-
with:
70-
github-token: ${{ secrets.GITHUB_TOKEN }}
71-
path-to-lcov: ${{ steps.coverage.outputs.report }}
39+
40+
- uses: actions/checkout@v4
41+
42+
- name: Install Rust stable
43+
uses: dtolnay/rust-toolchain@stable
44+
with:
45+
components: llvm-tools-preview
46+
47+
- name: Install grcov
48+
env:
49+
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
50+
run: |
51+
curl -L "$GRCOV_LINK/v$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" |
52+
tar xj -C $HOME/.cargo/bin
53+
54+
- name: Run tests
55+
env:
56+
RUSTFLAGS: "-Cinstrument-coverage"
57+
LLVM_PROFILE_FILE: "json-structural-diff-%p-%m.profraw"
58+
run: |
59+
cargo test --verbose
60+
61+
- name: Get coverage data for codecov
62+
run: |
63+
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
64+
--ignore-not-existing --ignore "/*" --ignore "../*" -o lcov.info
65+
66+
- name: Codecov upload
67+
uses: codecov/codecov-action@v4
68+
with:
69+
files: lcov.info
70+
token: ${{ secrets.CODECOV_TOKEN }}
7271

7372
tests:
7473

@@ -79,14 +78,10 @@ jobs:
7978
runs-on: ${{ matrix.platform }}
8079

8180
steps:
82-
- uses: actions/checkout@v2
81+
- uses: actions/checkout@v4
8382

8483
- name: Install stable
85-
uses: actions-rs/toolchain@v1
86-
with:
87-
profile: minimal
88-
toolchain: stable
89-
override: true
84+
uses: dtolnay/rust-toolchain@stable
9085

9186
- name: Build
9287
run: |

0 commit comments

Comments
 (0)