forked from probe-rs/probe-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (114 loc) · 3.5 KB
/
ci.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# This action builds* all the pushes to master, staging and trying which are required for bors.
# Additionally it builds* for each PR.
#
# * builds includes building, checking, testing, checking format and clippy, as well as the changelog.
on:
push:
branches: [master, staging, trying]
pull_request:
merge_group:
# Cancel any currently running workflows from the same PR, branch, or
# tag when a new workflow is triggered.
#
# https://stackoverflow.com/a/66336834
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
name: Run CI
jobs:
check:
name: Check
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-14
runs-on: ${{ matrix.os }}
env:
VCPKGRS_DYNAMIC: 1 # Use dynamic linking on Windows build (vcpkg)
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install libudev (linux)
run: |
sudo apt update
sudo apt install -y libudev-dev
# Only install on Ubuntu
if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'ubuntu-20.04')
- name: Cache Dependencies
uses: Swatinem/[email protected]
- name: cargo check for probe-rs, --no-default-features
run: cargo check -p probe-rs --no-default-features --locked
- name: Run cargo check
run: cargo check --all-features --locked
test:
name: Test Suite
# Run the test suite on both Linux and Windows,
# to ensure the path handling code works on both.
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
VCPKGRS_DYNAMIC: 1 # Use dynamic linking on Windows build (vcpkg)
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install libudev (linux)
run: |
sudo apt update
sudo apt install -y libudev-dev
# Only install on Ubuntu
if: matrix.os == 'ubuntu-latest'
- name: "Install thumbv7m-none-eabi target for tests"
run: rustup target add thumbv7m-none-eabi
- name: Cache Dependencies
uses: Swatinem/[email protected]
- name: Run cargo test
run: cargo test --all-features --locked
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install libudev
run: |
sudo apt update
sudo apt install -y libudev-dev
- name: Cache Dependencies
uses: Swatinem/[email protected]
- name: Run cargo clippy
run: cargo clippy --all-features --all-targets --locked -- -D warnings
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
doc:
name: Check docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install libudev
run: |
sudo apt update
sudo apt install -y libudev-dev
- name: Cache Dependencies
uses: Swatinem/[email protected]
- name: Run cargo doc
run: cargo doc -p probe-rs --no-deps --all-features --locked
env:
RUSTDOCFLAGS: '-D warnings'