-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 1.84 KB
/
code-checks.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
name: "Code Checks"
run-name: "Code Checks: ${{ github.event.pull_request.title }} ⛑️"
on:
pull_request:
types: [opened, synchronize]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: ${{ matrix.toolchain }} / ${{ matrix.arch.target }}
runs-on: ${{ matrix.arch.os }}
strategy:
fail-fast: false
matrix:
toolchain: [stable]
arch:
- {os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", cross: false}
# - {os: "ubuntu-latest", target: "armv7-unknown-linux-gnueabihf", cross: true}
# - {os: "ubuntu-latest", target: "aarch64-unknown-linux-gnu", cross: true}
steps:
- name: "Checkout repo 👉"
uses: actions/checkout@v4
- name: "Install toolchain 🦀"
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.arch.target }}
components: rustfmt, clippy
override: true
- name: "Fetch dependencies 🛠️"
uses: actions-rs/cargo@v1
with:
command: fetch
- name: "Check build platform 📺"
uses: actions-rs/cargo@v1
with:
command: check
args: --target=${{ matrix.arch.target }}
use-cross: ${{ matrix.arch.cross }}
- name: "Format code 🔍"
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: "Clippy code 🔍"
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features
- name: "Test code 🏃"
uses: actions-rs/cargo@v1
with:
command: test
- name: "Build code 🎁"
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target ${{ matrix.arch.target }}