Skip to content

Commit 82e03b3

Browse files
committed
Add a build workflow file.
1 parent 1891160 commit 82e03b3

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

.github/workflows/build.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '00 01 * * *'
9+
10+
jobs:
11+
check:
12+
name: Check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v2
17+
18+
- name: Install stable toolchain
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
profile: minimal
22+
toolchain: stable
23+
override: true
24+
25+
- uses: Swatinem/rust-cache@v1
26+
27+
- name: Run cargo check
28+
uses: actions-rs/cargo@v1
29+
with:
30+
command: check
31+
32+
test:
33+
name: Test Suite
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest, macos-latest, windows-latest]
37+
rust: [stable]
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- name: Checkout sources
41+
uses: actions/checkout@v2
42+
43+
- name: Install stable toolchain
44+
uses: actions-rs/toolchain@v1
45+
with:
46+
profile: minimal
47+
toolchain: ${{ matrix.rust }}
48+
override: true
49+
50+
- uses: Swatinem/rust-cache@v1
51+
52+
- name: Run cargo test
53+
uses: actions-rs/cargo@v1
54+
with:
55+
command: test
56+
57+
58+
lints:
59+
name: Lints
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout sources
63+
uses: actions/checkout@v2
64+
with:
65+
submodules: true
66+
67+
- name: Install stable toolchain
68+
uses: actions-rs/toolchain@v1
69+
with:
70+
profile: minimal
71+
toolchain: stable
72+
override: true
73+
components: rustfmt, clippy
74+
75+
- uses: Swatinem/rust-cache@v1
76+
77+
- name: Run cargo fmt
78+
uses: actions-rs/cargo@v1
79+
with:
80+
command: fmt
81+
args: --all -- --check
82+
83+
- name: Run cargo clippy
84+
uses: actions-rs/cargo@v1
85+
with:
86+
command: clippy
87+
args: -- -D warnings

0 commit comments

Comments
 (0)