-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (62 loc) · 1.7 KB
/
test.yml
File metadata and controls
71 lines (62 loc) · 1.7 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
name: Test
on:
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
pull_request:
push:
branches:
- development
# Run weekly on the default branch to make sure it always builds with the latest rust release
schedule:
- cron: '30 5 * * 1'
jobs:
lint:
# It is possible for lints to break after merge (e.g., new clippy checks), but it's not worth
# breaking the build if that happens. So we'll skip this job for scheduled runs.
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Lint
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
test-matrix:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@master
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
# This job reports the results of the test matrix above
test:
if: always()
needs: test-matrix
runs-on: ubuntu-latest
steps:
- if: needs.test-matrix.result != 'success'
name: Fail the build
run: exit 1