-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (98 loc) · 2.94 KB
/
ci.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
92
93
94
95
96
97
98
99
100
101
102
103
on: [push]
name: Lint and Test
env:
RUSTFLAGS: "-Dwarnings"
RUST_BACKTRACE: 1
jobs:
check:
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
id: toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: "1.80"
- name: cargo test
run: cargo test --workspace
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate Code Coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload Results to Codecov
uses: codecov/codecov-action@v3
env:
RUSTUP_TOOLCHAIN: ${{ steps.toolchain.outputs.name }}
with:
file: lcov.info
flags: unittests
name: iof
env_vars: OS,RUSTUP_TOOLCHAIN
# Failing to upload results will cause a CI error.
# So remember to use a token.
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
miri:
name: MIRI Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: miri
- name: cargo miri
run: cargo miri test --workspace
coverage:
name: Lint and Test Coverage
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
id: toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview, rustfmt, clippy
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --workspace --all-targets
- name: cargo doc
run: cargo doc --workspace
- name: cargo doc test
run: cargo test --doc --workspace
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate Code Coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload Results to Codecov
uses: codecov/codecov-action@v3
env:
RUSTUP_TOOLCHAIN: ${{ steps.toolchain.outputs.name }}
with:
file: lcov.info
flags: unittests
name: iof
env_vars: OS,RUSTUP_TOOLCHAIN
# Failing to upload results will cause a CI error.
# So remember to use a token.
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true