-
-
Notifications
You must be signed in to change notification settings - Fork 32
115 lines (109 loc) · 2.93 KB
/
build.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
## references:
# cache: https://github.com/actions/cache/blob/main/examples.md#rust---cargo
# audit: https://github.com/actions-rs/audit-check
# "needs": https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds
name: Build
on:
push:
branches: [ '*' ]
paths-ignore:
- "**/docs/**"
- "**.md"
pull_request:
branches: [ main ]
paths-ignore:
- "**/docs/**"
- "**.md"
workflow_call:
jobs:
check:
name: check
strategy:
fail-fast: false
matrix:
version: [ 'macos-latest', 'ubuntu-latest']
runs-on: ${{ matrix.version }}
steps:
- uses: actions/checkout@v2
- name: setup | rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v1
- run: cargo check
lint:
name: lint
needs: check
strategy:
fail-fast: false
matrix:
version: [ 'macos-latest', 'ubuntu-latest']
cargo-cmd:
- fmt --all -- --check
- clippy --all-targets --all-features -- -D warnings
runs-on: ${{ matrix.version }}
steps:
- uses: actions/checkout@v2
- name: setup | rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v1
- run: cargo ${{ matrix['cargo-cmd'] }}
tests:
name: test
needs: check
strategy:
fail-fast: false
matrix:
version: [ 'macos-latest', 'ubuntu-latest']
rust: [ nightly, stable ]
runs-on: ${{ matrix.version }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- uses: actions/checkout@v2
- name: setup | rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: cargo test
run: cargo test --all --locked -- -Z unstable-options
pkg-deb:
name: binary package .deb
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build .deb file
uses: sassman/rust-deb-builder@v1
- name: Archive deb artifact
uses: actions/upload-artifact@v2
with:
name: t-rec-amd64-static.deb
path: target/x86_64-unknown-linux-musl/debian/t-rec*.deb
audit:
name: security audit
needs: check
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: setup | rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- uses: Swatinem/rust-cache@v1
- name: audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}