-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (85 loc) · 2.34 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
89
on:
push:
branches:
- main
paths:
- '**.rs'
- '**.rs.gen'
- Cargo.toml
- Cargo.lock
- .github/workflows/cargo-test.yml
- 'rust-toolchain'
- 'rust-toolchain.toml'
- 'Makefile'
- 'spec.json'
pull_request:
paths:
- '**.rs'
- '**.rs.gen'
- Cargo.toml
- Cargo.lock
- .github/workflows/cargo-build.yml
- 'rust-toolchain'
- 'rust-toolchain.toml'
- 'Makefile'
- 'spec.json'
workflow_dispatch:
inputs:
permissions: read-all
name: cargo test
jobs:
cargotest:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo test
run: |
cargo test --all
env:
KITTYCAD_TEST_TOKEN: ${{secrets.KITTYCAD_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUST_BACKTRACE: 1
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
version: '0.15.0'
args: '--all --timeout 2000'
env:
KITTYCAD_TEST_TOKEN: ${{secrets.KITTYCAD_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUST_BACKTRACE: 1
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
flags: unittests
verbose: true