-
-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (48 loc) · 1.23 KB
/
ci.yml
File metadata and controls
51 lines (48 loc) · 1.23 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
on:
push:
branches:
- main
pull_request:
branches:
- main
name: CI
jobs:
lint:
name: Lint
# Typically one would use ubuntu-latest for clippy and rustfmt jobs. Use windows-latest in this
# case because most of the code is Windows-specific.
runs-on: windows-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Lint (rustfmt)
run: cargo xfmt --check
- name: Lint (clippy)
run: cargo clippy --all-features --all-targets
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
# 1.71 is the MSRV
rust-version: [ 1.71, stable ]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build
- name: Test
run: cargo test --all-features