-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (80 loc) · 2.1 KB
/
build-and-test.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build and Test
on:
push:
branches:
- staging
- trying
workflow_dispatch:
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
features: ["", "--no-default-features"]
target: ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
steps:
- uses: actions/checkout@v2
- if: ${{ matrix.target == 'i686-unknown-linux-gnu' }}
name: Install 32-bit system toolchain
run: |
sudo apt-get update
sudo apt-get install gcc-multilib -y
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release ${{ matrix.features }} --target ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.features }} --target ${{ matrix.target }}
rustfmt:
name: Check Source Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Lint with Clippy
env:
RUSTFLAGS: "-D warnings"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
audit:
name: Cargo Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
bors-gate:
runs-on: ubuntu-latest
needs: [build-and-test, rustfmt, clippy, audit]
steps:
- run: "true"