-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (52 loc) · 1.37 KB
/
test.yaml
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
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- '**.rs'
- .github/**
- Cargo.toml
jobs:
build_and_test:
if: contains(toJson(github.event), '***NO_CI***') == false && contains(toJson(github.event), 'ci skip') == false && contains(toJson(github.event), 'skip ci') == false
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
# nightly toolchain is only used for checking fmt compliance
toolchain: [stable, nightly]
steps:
- name: Fetch
uses: actions/checkout@v2
- name: Rustup
uses: actions-rs/toolchain@v1
with:
override: true
profile: default
toolchain: ${{ matrix.toolchain }}
# Check for rustfmt compliance
- name: Check rustfmt
uses: actions-rs/cargo@v1
if: matrix.toolchain == 'nightly'
with:
command: fmt
args: -- --check
# Check for Clippy lints
- name: Clippy
uses: actions-rs/cargo@v1
if: matrix.toolchain != 'nightly'
with:
command: clippy
args: --all-targets
- name: Build
uses: actions-rs/cargo@v1
if: matrix.toolchain != 'nightly'
with:
command: build
- name: Test
uses: actions-rs/cargo@v1
if: matrix.toolchain != 'nightly'
with:
command: test