-
-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (68 loc) · 2.34 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
name: CI
on: [push, pull_request]
jobs:
code_quality:
name: Code Quality
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- uses: taiki-e/install-action@just
- uses: taiki-e/install-action@dprint
- uses: taiki-e/install-action@v2
with:
tool: typos-cli
- name: Ensure `fmt` has been run
run: just fmt-check
- name: Run clippy
run: just lint
msrv:
name: Minimum Supported Rust Version
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@just
- uses: taiki-e/install-action@nextest
- name: Run tests
run: just test
build:
name: Build for ${{ matrix.build }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { build: linux-gnu, os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
- { build: linux-musl, os: ubuntu-22.04, target: x86_64-unknown-linux-musl }
- { build: win-gnu, os: windows-2022, target: x86_64-pc-windows-gnu }
- { build: win-msvc, os: windows-2022, target: x86_64-pc-windows-msvc }
- { build: win32-msvc, os: windows-2022, target: i686-pc-windows-msvc }
- { build: macos, os: macos-12 , target: x86_64-apple-darwin }
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: Show version information
shell: bash
run: |
rustc --version
cargo --version
- name: Install musl-tools
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
--allow-unauthenticated musl-tools
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.target }}
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}