-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (40 loc) · 1.38 KB
/
ci.yml
File metadata and controls
52 lines (40 loc) · 1.38 KB
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
name: Cargo check, fmt, and clippy
on:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
CLIPPY_OPTIONS: |
-W warnings
-W clippy::std_instead_of_core -W clippy::std_instead_of_alloc -W clippy::alloc_instead_of_core
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
fmt-clippy:
strategy:
fail-fast: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.10
with:
components: rustfmt,clippy
target: aarch64-unknown-linux-gnu
- name: Set up Rust toolchain and cache (baremetal)
uses: actions-rust-lang/setup-rust-toolchain@v1.10
with:
target: aarch64-unknown-none-softfloat
- uses: taiki-e/install-action@cargo-hack # for workspace feature unificiation
- name: build init
working-directory: ./crates/init
run: ./build.sh
- name: cargo check
run: cargo hack check --workspace --tests --examples --target=aarch64-unknown-linux-gnu
- name: cargo clippy
run: cargo hack clippy --workspace --tests --examples --target=aarch64-unknown-linux-gnu -- $CLIPPY_OPTIONS
- name: cargo fmt
run: cargo fmt --all -- --check