-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.92 KB
/
Copy pathci.yml
File metadata and controls
71 lines (60 loc) · 1.92 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
69
70
71
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install perl (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y perl
- name: Install nasm (Windows)
if: matrix.os == 'windows-latest'
run: choco install nasm -y --no-progress
shell: pwsh
- name: Install nasm (macOS)
if: matrix.os == 'macos-latest'
run: brew install nasm
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
- name: Test
run: cargo test
lint:
name: Lint (rustfmt + clippy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y perl
# Install on the EXACT toolchain rust-toolchain.toml pins (1.88.0).
# `@stable` would install rustfmt/clippy on the latest stable instead,
# but `cargo` ends up calling the pinned 1.88.0 toolchain that lacks
# those components, producing `'cargo-fmt' is not installed for the
# toolchain '1.88.0-x86_64-unknown-linux-gnu'`.
- uses: dtolnay/rust-toolchain@1.88.0
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
msrv:
name: MSRV (1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y perl
- uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2
- run: cargo build --release