-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.66 KB
/
tests.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
name: Tests
on:
push:
branches: [main]
paths:
- 'library/**'
- '!library/README.md'
- Cargo.toml
- .github/workflows/tests.yml
pull_request:
branches: [main]
paths:
- 'library/**'
- '!library/README.md'
- Cargo.toml
- .github/workflows/tests.yml
jobs:
lint-lib:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Just
run: cargo binstall -y just
- name: Cache deps
uses: actions/cache@v4
with:
path: ~/.cargo
key: cargo-lib-${{ hashFiles('lib/src/**', 'lib/Cargo.toml') }}
- run: just lint
test:
needs: [lint-lib]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Just
run: cargo binstall -y just cargo-nextest cargo-llvm-cov
- name: Cache deps
uses: actions/cache@v4
with:
path: ~/.cargo
key: cargo-lib-${{ hashFiles('lib/src/**', 'lib/Cargo.toml') }}
- run: rustup component add llvm-tools-preview
# this enables a tool (for default toolchain) needed to measure code coverage.
- name: Run tests and generate reports
run: just test ci lcov
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true