-
Notifications
You must be signed in to change notification settings - Fork 27
168 lines (152 loc) · 4.71 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Continuous Integration
on:
merge_group:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# UTC
- cron: '48 4 * * *'
env:
CARGO_TERM_COLOR: always
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7em-none-eabihf
override: true
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --verbose
- uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install py/
pip install pylint
- name: Run Pylint
run: |
pylint py/stabilizer
compile:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.continue-on-error }}
strategy:
matrix:
toolchain: [stable]
features: ['']
continue-on-error: [false]
include:
- toolchain: beta
features: ''
continue-on-error: true
- toolchain: nightly
features: nightly
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: thumbv7em-none-eabihf
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --features "${{ matrix.features }}"
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7em-none-eabihf
override: true
- uses: Swatinem/rust-cache@v1
- uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.12'
- name: Install Deadlinks
uses: actions-rs/cargo@v1
with:
command: install
args: |
cargo-deadlinks
- name: Install Linkcheck
uses: actions-rs/cargo@v1
with:
command: install
args: mdbook-linkcheck
- name: cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps -p miniconf -p idsp -p ad9959 -p stabilizer
- name: cargo deadlinks
uses: actions-rs/cargo@v1
with:
command: deadlinks
# We intentionally ignore fragments, as RTIC may generate fragments for various
# auto-generated code.
args: --dir target/thumbv7em-none-eabihf/doc --ignore-fragments --check-intra-doc-links
- name: Test Book
working-directory: book
run: |
# Install depedencies at our cache location
mv ../target/thumbv7em-none-eabihf/doc src/firmware
mdbook build
hitl-trigger:
runs-on: ubuntu-latest
environment: hitl
# This crucially marks the job as "skipped" when not in the merge queue thus
# counting as passing the required check when adding it to the merge queue.
# See
# https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution#overview
if: ${{ github.event_name == 'merge_group' }}
steps:
- uses: LouisBrunner/[email protected]
id: hitl-check
with:
repo: ${{ github.repository }}
sha: ${{ github.event.head_commit.id }}
token: ${{ github.token }}
name: HITL Run Status
status: in_progress
details_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
output: |
{"summary": "Starting..."}
- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.DISPATCH_PAT }}
event-type: stabilizer
repository: quartiq/hitl
client-payload: |
{"github": ${{ toJson(github) }}, "check_id": ${{steps.hitl-check.outputs.check_id}}}
- uses: fountainhead/[email protected]
id: status
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: HITL Run Status
ref: ${{ github.event.pull_request.head.sha }}
# The HITL can be backlogged by multiple queues, where each takes ~5 minutes to complete.
timeoutSeconds: 3600
- name: "Check HITL Status"
if: steps.status.outputs.conclusion != 'success'
run: exit -1