-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (84 loc) · 2.45 KB
/
cargo-test.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
on:
push:
branches:
- main
paths:
- '**.rs'
- '**.rs.gen'
- Cargo.toml
- Cargo.lock
- .github/workflows/cargo-test.yml
- 'rust-toolchain.toml'
- 'Makefile'
- 'spec.json'
pull_request:
paths:
- '**.rs'
- '**.rs.gen'
- Cargo.toml
- Cargo.lock
- .github/workflows/cargo-test.yml
- 'rust-toolchain.toml'
- 'Makefile'
- 'spec.json'
workflow_dispatch:
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: cargo test
jobs:
cargotest:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install latest rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: taiki-e/install-action@nextest
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Run cargo test
run: |
cargo nextest run --workspace
env:
ZOO_TEST_TOKEN: ${{secrets.KITTYCAD_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUST_BACKTRACE: 1
- name: Test with coverage
run: cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --no-fail-fast
env:
ZOO_TEST_TOKEN: ${{secrets.KITTYCAD_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUST_BACKTRACE: 1
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
flags: unittests
files: lcov.info
verbose: true