-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (58 loc) · 2.04 KB
/
rust-ci.yaml
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
name: "Rust CI"
on:
push:
branches:
- main
pull_request:
jobs:
lint:
uses: darbiadev/.github/.github/workflows/rust-lint.yaml@29197a38ef3741064f47b623ede0c1ad22402c57 # v13.0.3
clippy:
needs: lint
uses: darbiadev/.github/.github/workflows/rust-clippy.yaml@29197a38ef3741064f47b623ede0c1ad22402c57 # v13.0.3
test:
needs: clippy
strategy:
matrix:
triple:
- { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu" }
uses: darbiadev/.github/.github/workflows/rust-test.yaml@29197a38ef3741064f47b623ede0c1ad22402c57 # v13.0.3
with:
os: ${{ matrix.triple.os }}
target: ${{ matrix.triple.target }}
docs:
permissions:
contents: read
pages: write
id-token: write
uses: darbiadev/.github/.github/workflows/github-pages-rust-doc.yaml@29197a38ef3741064f47b623ede0c1ad22402c57 # v13.0.3
coverage:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Cache Rust and project dependencies"
id: cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ hashFiles('Cargo.lock') }}
- name: "Install grcov"
if: steps.cache.outputs.cache-hit != 'true'
run: cargo install grcov
- name: "Run tests"
run: cargo test --no-fail-fast
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "selene-%p-%m.profraw"
- name: "Generate coverage data"
run: |
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}