Debian Codegraph @

.github/workflows/build.yaml

raw symbols SCIP
1 name: checks
2
3 permissions:
4 contents: read
5
6 on:
7 push:
8 branches:
9 - main
10 pull_request:
11 schedule:
12 - cron: '0 4 * * *'
13 merge_group:
14 branches:
15 - main
16
17 jobs:
18 format:
19 name: Format
20 runs-on: ubuntu-latest
21 steps:
22 - name: Checkout sources
23 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
24 with:
25 persist-credentials: false
26 - name: Install rust toolchain
27 uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
28 with:
29 toolchain: stable
30 override: true
31 default: true
32 components: rustfmt
33 - name: Check formatting
34 uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
35 with:
36 command: fmt
37 args: --all --check
38
39 build:
40 name: Clippy & Test ${{ matrix.os }}
41 runs-on: ${{ matrix.os }}
42 strategy:
43 matrix:
44 # os: [ubuntu-latest, macos-latest]
45 os: [ubuntu-latest]
46 rust:
47 - 1.66.0
48 target:
49 - ""
50 features:
51 - ""
52 steps:
53 - name: Checkout sources
54 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
55 with:
56 persist-credentials: false
57 - name: Install ${{ matrix.rust }} toolchain
58 uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
59 with:
60 toolchain: ${{ matrix.rust }}
61 override: true
62 - name: cargo build
63 run: cargo build ${{ matrix.features }}
64 - name: cargo test
65 run: cargo test
66 env:
67 RUST_BACKTRACE: 1
68
69 build-musl:
70 name: Clippy & Test ubuntu-latest / MUSL
71 runs-on: ubuntu-latest
72 steps:
73 - name: Checkout sources
74 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
75 with:
76 persist-credentials: false
77 - name: Install rust toolchain
78 uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
79 with:
80 toolchain: stable
81 override: true
82 default: true
83 components: clippy
84 target: x86_64-unknown-linux-musl
85 - name: cargo build
86 run: cargo build ${{ matrix.features }}
87 - name: cargo test
88 run: cargo test
89 env:
90 RUST_BACKTRACE: 1
91
92 build-freebsd:
93 name: Clippy & Test FreeBSD
94 runs-on: ubuntu-latest
95 timeout-minutes: 30
96 steps:
97 - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
98 - name: test on freebsd
99 uses: vmactions/freebsd-vm@12c207ac1ba13827f25726fe93f9c2e6f685f0f3
100 with:
101 usesh: true
102 mem: 4096
103 copyback: false
104 prepare: |
105 pkg install -y curl
106 curl https://sh.rustup.rs -sSf --output rustup.sh
107 sh rustup.sh -y --profile default --default-toolchain 1.66.0 # cannot use `--profile minimal` because of clippy
108 echo "~~~~ rustc --version ~~~~"
109 $HOME/.cargo/bin/rustc --version
110 echo "~~~~ freebsd-version ~~~~"
111 freebsd-version
112 run: $HOME/.cargo/bin/cargo clippy -- -D warnings && $HOME/.cargo/bin/cargo build && $HOME/.cargo/bin/cargo test
113
114 clippy-raspberry-pi:
115 name: ClippyRaspberryPi
116 runs-on: ubuntu-latest
117 steps:
118 - name: Checkout sources
119 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
120 with:
121 persist-credentials: false
122 - name: Install rust toolchain
123 uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
124 with:
125 toolchain: stable
126 override: true
127 default: true
128 components: clippy
129 target: armv7-unknown-linux-gnueabihf
130 # Use zig as our C compiler for convenient cross-compilation. We run into rustls having a dependency on `ring`.
131 # This crate uses C and assembly code, and because of its build scripts, `cargo clippy` needs to be able to compile
132 # that code for our target.
133 - uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d
134 with:
135 version: 0.9.0
136 - name: Install cargo-zigbuild
137 uses: taiki-e/install-action@3e71e7135de310b70bc22dccb4d275acde8e055a
138 with:
139 tool: cargo-zigbuild
140 - name: Run clippy
141 uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
142 env:
143 TARGET_CC: "/home/runner/.cargo/bin/cargo-zigbuild zig cc -- -target arm-linux-gnueabihf -mcpu=generic+v7a+vfp3-d32+thumb2-neon -g"
144 with:
145 command: clippy
146 args: --target armv7-unknown-linux-gnueabihf --workspace --all-targets -- -D warnings