-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (137 loc) · 4.52 KB
/
build.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: checks
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 4 * * *'
merge_group:
branches:
- main
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
- name: Install rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
override: true
default: true
components: rustfmt
- name: Check formatting
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: fmt
args: --all --check
build:
name: Clippy & Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust:
- 1.66.0
target:
- ""
features:
- ""
steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
- name: Install ${{ matrix.rust }} toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: ${{ matrix.rust }}
override: true
- name: cargo build
run: cargo build ${{ matrix.features }}
- name: cargo test
run: cargo test
env:
RUST_BACKTRACE: 1
build-musl:
name: Clippy & Test ubuntu-latest / MUSL
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
- name: Install rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
override: true
default: true
components: clippy
target: x86_64-unknown-linux-musl
- name: cargo build
run: cargo build ${{ matrix.features }}
- name: cargo test
run: cargo test
env:
RUST_BACKTRACE: 1
build-freebsd:
name: Clippy & Test FreeBSD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: test on freebsd
uses: vmactions/freebsd-vm@d7b8fcc7711aa41ad45e8d9b737cf90f035a7e3d
with:
usesh: true
mem: 4096
copyback: false
prepare: |
pkg install -y curl
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile default --default-toolchain 1.66.0 # cannot use `--profile minimal` because of clippy
echo "~~~~ rustc --version ~~~~"
$HOME/.cargo/bin/rustc --version
echo "~~~~ freebsd-version ~~~~"
freebsd-version
run: $HOME/.cargo/bin/cargo clippy -- -D warnings && $HOME/.cargo/bin/cargo build && $HOME/.cargo/bin/cargo test
clippy-raspberry-pi:
name: ClippyRaspberryPi
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
- name: Install rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
override: true
default: true
components: clippy
target: armv7-unknown-linux-gnueabihf
# Use zig as our C compiler for convenient cross-compilation. We run into rustls having a dependency on `ring`.
# This crate uses C and assembly code, and because of its build scripts, `cargo clippy` needs to be able to compile
# that code for our target.
- uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d
with:
version: 0.9.0
- name: Install cargo-zigbuild
uses: taiki-e/install-action@42f4ec8e42bf7fe4dadd39bfc534566095a8edff
with:
tool: cargo-zigbuild
- name: Run clippy
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
env:
TARGET_CC: "/home/runner/.cargo/bin/cargo-zigbuild zig cc -- -target arm-linux-gnueabihf -mcpu=generic+v7a+vfp3-d32+thumb2-neon -g"
with:
command: clippy
args: --target armv7-unknown-linux-gnueabihf --workspace --all-targets -- -D warnings