-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (49 loc) · 1.11 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
name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["main"]
merge_group:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- "1.70"
- stable
- beta
- nightly
cargo-update:
- true
include:
- rust: stable
cargo-update: false
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Update
if: matrix.cargo-update
run: cargo update
- name: Run tests
run: cargo test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt clippy
- name: Run rustfmt check
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all --all-targets -- -D warnings