-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (81 loc) · 2.6 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
name: Continuous Integration
on:
merge_group:
push:
branches: [main, staging, trying]
pull_request:
branches: [main]
schedule:
# UTC
- cron: '48 4 * * *'
env:
CARGO_TERM_COLOR: always
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf
components: rustfmt, clippy
- run: cargo fmt --all -- --check
- run: cargo check
- run: cargo clippy --all-features -- -D warnings
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- run: cargo build
- run: cargo build --release
- name: Extract Binary
run: cargo objcopy --release --verbose -- -O binary booster-release.bin
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main'
with:
name: Firmware Images
path: |
target/*/release/booster
booster-release.bin
hitl-trigger:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'merge_group' }}
environment: hitl
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@v3
with:
token: ${{ secrets.DISPATCH_PAT }}
event-type: booster
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 enqueues, where each can take up to 10 minutes.
timeoutSeconds: 3600
- name: "Check HITL Status"
if: steps.status.outputs.conclusion != 'success'
run: exit -1