-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (56 loc) · 1.55 KB
/
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
71
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: read-all
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
- name: Manage Rust cache
uses: Swatinem/rust-cache@v2
- name: Check code formatting
run: cargo fmt --check
- name: Lint code
run: cargo clippy
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
- name: Manage Rust cache
uses: Swatinem/rust-cache@v2
- name: Install devtools
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall,cargo-llvm-cov,cargo-nextest
- name: Install 1Password CLI
uses: 1password/install-cli-action@v1
- name: Run tests
run: |
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info
cargo llvm-cov report --summary-only
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: target/nextest/default/junit.xml
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: lcov.info