-
Notifications
You must be signed in to change notification settings - Fork 23
59 lines (59 loc) · 1.42 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
name: CI
on:
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
rust:
- stable
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Ready cache
if: matrix.os == 'ubuntu-latest'
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --target ${{ matrix.target }}
lint:
name: Linting (fmt + clippy)
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Checkout
uses: actions/checkout@v4
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
- name: Format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check