Repository navigation
68 lines (63 loc) · 1.87 KB
/
Copy pathci.yml
File metadata and controls
68 lines (63 loc) · 1.87 KB
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
name: CI
on:
push:
branches: [ "main", "master", "develop" ]
pull_request:
branches: [ "main", "master", "develop" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test · ${{ matrix.os }}
runs-on: ${{ fromJSON(matrix.runner) }}
strategy:
fail-fast: false
matrix:
include:
- os: linux
runner: '["self-hosted","s31"]'
- os: macos
runner: '["self-hosted","macOS","s11"]'
- os: windows
runner: '["self-hosted","Windows","s18"]'
steps:
- uses: actions/checkout@v4
- name: Install rustup without touching shell profiles (macOS)
if: runner.os == 'macOS'
run: |
if [ ! -x "$HOME/.cargo/bin/rustup" ]; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y --no-modify-path
fi
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run tests
run: cargo test --verbose
clippy:
name: Clippy lint
runs-on: [self-hosted, s31]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Lint with Clippy
run: cargo clippy -- -D warnings
fmt:
name: Rustfmt check
runs-on: [self-hosted, s31]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --check