-
-
Notifications
You must be signed in to change notification settings - Fork 57
94 lines (74 loc) · 2.05 KB
/
rust.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
80
81
82
83
84
85
86
87
88
89
90
91
name: Rust
on: [push, pull_request]
jobs:
rustfmt-clippy:
name: Format and Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy, rustfmt
- name: Run rustfmt
run: |
cargo fmt --all -- --check
- name: Run clippy
uses: actions-rs-plus/[email protected]
with:
args: --all -- -D warnings
coverage:
needs: arch-test
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install grcov
env:
LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_VERSION: 0.8.7
run: |
curl -L "$LINK/v$GRCOV_VERSION/grcov-x86_64-unknown-linux-gnu.tar.bz2" |
tar xj -C $HOME/.cargo/bin
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
cc: false
- name: Run grcov
id: coverage
run: bash coverage.sh
- name: Codecov upload
uses: codecov/codecov-action@v4
with:
files: coverage.lcov
arch-test:
needs: rustfmt-clippy
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
toolchain: [nightly, stable]
include:
- toolchain: nightly-gnu
os: windows-latest
- toolchain: stable-gnu
os: windows-latest
name: ${{matrix.os}}-${{matrix.toolchain}}
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install ${{matrix.toolchain}}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{matrix.toolchain}}
- name: Build
run: |
cargo build --verbose
- name: Run tests
run: |
cargo test --verbose