-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (76 loc) · 2.07 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
name: codecov-rs CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Lint (rustfmt + clippy)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: clippy, rustfmt
- name: Run lint
run: |
cargo fmt --all --check
cargo clippy
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
- name: Run build
run: |
cargo build
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
- name: Run tests
run: |
cargo test
- name: Install `cargo llvm-cov`
uses: taiki-e/install-action@cargo-llvm-cov
- name: Collect coverage
run: |
cargo llvm-cov --lcov --output-path lcov.info
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_ORG_TOKEN }}
- name: Generate JUnit test results
# Run tests again but with JSON output. Convert to junit then upload.
# The original format is nicer to look at in CI error messages.
run: |
cargo install cargo2junit
cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml
- name: Upload test results
uses: codecov/test-results-action@v1
with:
file: ./results.xml
token: ${{ secrets.CODECOV_ORG_TOKEN }}
verbose: true