-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (88 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
102 lines (88 loc) · 2.71 KB
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
name: CI
on:
pull_request:
push:
branches: [main]
paths:
- 'bridge/**'
- 'pico-bridge/**'
- 'scripts/**'
- 'tools/**'
- 'build.ps1'
- 'setup.ps1'
- '.clang-format'
- '.editorconfig'
- '.github/scripts/**'
- '.github/workflows/**'
workflow_dispatch:
permissions:
contents: read
jobs:
bridge:
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust cache
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
bridge/target
key: ${{ runner.os }}-bridge-${{ hashFiles('bridge/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-bridge-
- name: Lint Rust and scripts
shell: pwsh
run: ./tools/lint.ps1 -SkipFirmware
- name: Rust tests
run: cargo test --manifest-path bridge/Cargo.toml --locked
firmware:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Pico build cache
uses: actions/cache@v5
with:
path: |
pico-bridge/build-_pico_sdk
pico-bridge/build-pico2w
pico-bridge/build-picow
key: ${{ runner.os }}-pico-${{ hashFiles('pico-bridge/CMakeLists.txt', 'pico-bridge/pico_sdk_import.cmake', 'pico-bridge/scripts/build.ps1', 'pico-bridge/src/**') }}
restore-keys: |
${{ runner.os }}-pico-
- name: Install Pico toolchain
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build gcc-arm-none-eabi libnewlib-arm-none-eabi clang-format
- name: Firmware formatting
shell: pwsh
run: ./tools/lint.ps1 -SkipRust -SkipPowerShell
- name: Host unit tests (CDC framing)
run: |
cmake -S pico-bridge/tests -B build-host-tests
cmake --build build-host-tests
ctest --test-dir build-host-tests --output-on-failure
- name: Build firmware (both boards)
shell: pwsh
run: ./pico-bridge/scripts/build.ps1 -Release
- name: Verify both UF2s present
shell: pwsh
run: |
$files = @(
'pico-bridge/dist/couchlink-pico2w.uf2',
'pico-bridge/dist/couchlink-picow.uf2'
)
foreach ($f in $files) {
if (-not (Test-Path -LiteralPath $f)) { throw "Missing $f" }
$size = (Get-Item -LiteralPath $f).Length
Write-Host "$f -- $size bytes"
}