-
Notifications
You must be signed in to change notification settings - Fork 438
67 lines (64 loc) · 1.64 KB
/
rust.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
name: Rust
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- name: windows-latest
runs-on: [self-hosted, Windows]
self-hosted: true
- name: ubuntu-latest
runs-on: ubuntu-latest
self-hosted: false
- name: macos-latest
runs-on: macos-latest
self-hosted: false
fail-fast: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable
- uses: Swatinem/rust-cache@v2
if: ${{ ! matrix.self-hosted }}
with:
shared-key: ${{ matrix.name }}
- name: Build tests
run: cargo build --profile=CI --verbose --tests
- name: Run tests
run: cargo test --profile=CI --verbose
- name: Build examples
run: cargo build --profile=CI --verbose --bins
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --component clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: ubuntu-latest
save-if: "false"
- name: Run clippy check
run: cargo clippy --profile=CI -- -Dwarnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly --component rustfmt
- name: Run fmt check
run: cargo +nightly fmt --check
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run typos
uses: crate-ci/typos@master