-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (119 loc) · 3.68 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
on:
workflow_dispatch:
pull_request:
paths:
- '**.rs'
- .github/workflows/ci.yml
- Cargo.lock
- Cargo.toml
- '**/Cargo.toml'
- rust-toolchain.toml
permissions: read-all
name: Rust CI
jobs:
cargo-test:
name: cargo test
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- uses: Swatinem/[email protected]
- name: Install ffmpeg
run: |
sudo apt update
sudo apt install \
ffmpeg \
libavformat-dev \
libavutil-dev \
libclang-dev \
libswscale-dev \
--no-install-recommends
- name: cargo test
shell: bash
run: |
export KITTYCAD_API_TOKEN=${{secrets.KITTYCAD_API_TOKEN}}
cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info
env:
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
files: lcov.info
cargo-clippy:
name: cargo clippy
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/[email protected]
- name: Run clippy (no default features)
shell: bash
run: cargo clippy --tests --benches --workspace --examples --no-default-features -- -D warnings
env:
RUST_BACKTRACE: 1
- name: Run clippy (only default features)
shell: bash
run: cargo clippy --tests --benches --workspace --examples -- -D warnings
env:
RUST_BACKTRACE: 1
- name: Run clippy (all features)
shell: bash
run: cargo clippy --tests --benches --workspace --examples --all-features -- -D warnings
env:
RUST_BACKTRACE: 1
cargo-fmt:
name: cargo fmt
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt
shell: bash
run: |
cargo fmt
env:
RUST_BACKTRACE: 1
check-typos:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- name: Install codespell
run: python -m pip install codespell
- name: Run codespell
# Edit this file to tweak the typo list and other configuration.
run: codespell --config .codespellrc
cargo-toml-sorted:
name: Check Cargo.toml is sorted
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install cargo-sort
run: cargo install cargo-sort
- name: Run check
run: cargo sort --workspace --check
semver-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: kittycad-modeling-cmds