-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.37 KB
/
build.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
name: build
on:
push:
branches:
- main
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '!**.md'
pull_request:
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '!**.md'
env:
TZ: Europe/Zurich
CARGO_TERM_COLOR: always
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
target: x86_64-unknown-linux-musl
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- run: cargo binstall -y cross
- run: cargo clippy
- name: run the security audit check
run: cargo audit
- name: run the tests for x86_64 target
run: cross test --target x86_64-unknown-linux-musl
- name: run cargo clean
run: cargo clean
- name: run the test for arm64 target
run: cross test --target aarch64-unknown-linux-musl