-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (60 loc) · 1.65 KB
/
main.yaml
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
name: "Main workflow"
on:
- push
jobs:
configure:
runs-on: ubuntu-latest
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT
lint:
runs-on: ubuntu-latest
container:
image: zondax/rust-ci:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libusb-1.0-0-dev
- name: show versions
run: |
rustup show
- name: rustfmt
run: |
cargo fmt --version
cargo fmt -- --check
- name: rust cache
uses: Swatinem/rust-cache@v2
with:
# setup shared-key to share cache with other jobs
shared-key: ${{ github.run_id }}-${{ github.run_attempt }}
- name: clippy
run: |
cargo clippy --version
cargo clippy --all-features
tests:
runs-on: ubuntu-latest
container:
image: zondax/rust-ci:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Rust Dependency Cache
uses: Swatinem/rust-cache@v2
with:
# setup shared-key to share cache with other jobs
shared-key: ${{ github.run_id }}-${{ github.run_attempt }}
- run: |
sudo apt-get update
sudo apt-get install -y libudev-dev libusb-1.0.0-dev
- name: test --all-features
run: |
#with --lib we only test the unit tests
cargo test --lib --all-features