| 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 |
rust: |
| 46 |
- 1.66.0 |
| 47 |
target: |
| 48 |
- "" |
| 49 |
features: |
| 50 |
- "" |
| 51 |
steps: |
| 52 |
- name: Checkout sources |
| 53 |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 54 |
with: |
| 55 |
persist-credentials: false |
| 56 |
- name: Install ${{ matrix.rust }} toolchain |
| 57 |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af |
| 58 |
with: |
| 59 |
toolchain: ${{ matrix.rust }} |
| 60 |
override: true |
| 61 |
- name: cargo build |
| 62 |
run: cargo build ${{ matrix.features }} |
| 63 |
- name: cargo test |
| 64 |
run: cargo test |
| 65 |
env: |
| 66 |
RUST_BACKTRACE: 1 |
| 67 |
|
| 68 |
build-musl: |
| 69 |
name: Clippy & Test ubuntu-latest / MUSL |
| 70 |
runs-on: ubuntu-latest |
| 71 |
steps: |
| 72 |
- name: Checkout sources |
| 73 |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 74 |
with: |
| 75 |
persist-credentials: false |
| 76 |
- name: Install rust toolchain |
| 77 |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af |
| 78 |
with: |
| 79 |
toolchain: stable |
| 80 |
override: true |
| 81 |
default: true |
| 82 |
components: clippy |
| 83 |
target: x86_64-unknown-linux-musl |
| 84 |
- name: cargo build |
| 85 |
run: cargo build ${{ matrix.features }} |
| 86 |
- name: cargo test |
| 87 |
run: cargo test |
| 88 |
env: |
| 89 |
RUST_BACKTRACE: 1 |
| 90 |
|
| 91 |
build-freebsd: |
| 92 |
name: Clippy & Test FreeBSD |
| 93 |
runs-on: ubuntu-latest |
| 94 |
steps: |
| 95 |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 96 |
- name: test on freebsd |
| 97 |
uses: vmactions/freebsd-vm@12c207ac1ba13827f25726fe93f9c2e6f685f0f3 |
| 98 |
with: |
| 99 |
usesh: true |
| 100 |
mem: 4096 |
| 101 |
copyback: false |
| 102 |
prepare: | |
| 103 |
pkg install -y curl |
| 104 |
curl https://sh.rustup.rs -sSf --output rustup.sh |
| 105 |
sh rustup.sh -y --profile default --default-toolchain 1.66.0 # cannot use `--profile minimal` because of clippy |
| 106 |
echo "~~~~ rustc --version ~~~~" |
| 107 |
$HOME/.cargo/bin/rustc --version |
| 108 |
echo "~~~~ freebsd-version ~~~~" |
| 109 |
freebsd-version |
| 110 |
run: $HOME/.cargo/bin/cargo clippy -- -D warnings && $HOME/.cargo/bin/cargo build && $HOME/.cargo/bin/cargo test |
| 111 |
|
| 112 |
clippy-raspberry-pi: |
| 113 |
name: ClippyRaspberryPi |
| 114 |
runs-on: ubuntu-latest |
| 115 |
steps: |
| 116 |
- name: Checkout sources |
| 117 |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 118 |
with: |
| 119 |
persist-credentials: false |
| 120 |
- name: Install rust toolchain |
| 121 |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af |
| 122 |
with: |
| 123 |
toolchain: stable |
| 124 |
override: true |
| 125 |
default: true |
| 126 |
components: clippy |
| 127 |
target: armv7-unknown-linux-gnueabihf |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
- uses: goto-bus-stop/setup-zig@7ab2955eb728f5440978d5824358023be3a2802d |
| 132 |
with: |
| 133 |
version: 0.9.0 |
| 134 |
- name: Install cargo-zigbuild |
| 135 |
uses: taiki-e/install-action@32300fcc7462d35c920c6d4a42efe7bc39b61569 |
| 136 |
with: |
| 137 |
tool: cargo-zigbuild |
| 138 |
- name: Run clippy |
| 139 |
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 |
| 140 |
env: |
| 141 |
TARGET_CC: "/home/runner/.cargo/bin/cargo-zigbuild zig cc -- -target arm-linux-gnueabihf -mcpu=generic+v7a+vfp3-d32+thumb2-neon -g" |
| 142 |
with: |
| 143 |
command: clippy |
| 144 |
args: --target armv7-unknown-linux-gnueabihf --workspace --all-targets -- -D warnings |