-
Notifications
You must be signed in to change notification settings - Fork 162
179 lines (170 loc) · 6.9 KB
/
test.yml
File metadata and controls
179 lines (170 loc) · 6.9 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
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
169
170
171
172
173
174
175
176
177
178
179
on:
push:
pull_request:
jobs:
build:
# Prevent running twice for PRs from same repo
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Build & Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
generator: ["Ninja", "Unix Makefiles", "Visual Studio 17 2022"]
mbedtls: ["mbedtls", ""]
libusb: ["libusb", ""]
compile: ["compile", ""]
exclude:
- os: 'windows-latest'
generator: "Unix Makefiles"
- os: 'ubuntu-latest'
generator: "Visual Studio 17 2022"
- os: 'macos-latest'
generator: "Visual Studio 17 2022"
- libusb: ""
compile: "compile"
- os: 'windows-latest'
# only precompiled ELFs supported for Windows MSVC
compile: "compile"
generator: "Visual Studio 17 2022"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install mingw (Windows mingw)
if: runner.os == 'Windows' && matrix.generator == 'Ninja'
run: |
choco install -y mingw --version=12.2.0
- name: Install arm-none-eabi-gcc (Windows & MacOS)
if: runner.os == 'Windows' || runner.os == 'macOS'
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: 14.3.Rel1
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
curl -L https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z -o libusb.7z
7z x libusb.7z -olibusb
ls libusb
- name: Set LIBUSB_ROOT (Windows)
if: runner.os == 'Windows'
run: |
"LIBUSB_ROOT=$(pwd)/libusb" >> $env:GITHUB_ENV
- name: Check LIBUSB_ROOT (Windows)
if: runner.os == 'Windows'
run: |
echo $env:LIBUSB_ROOT
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install libusb ninja
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt install cmake ninja-build python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev
- name: Checkout Pico SDK
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk
submodules: ${{ matrix.mbedtls && 'recursive' || 'false' }}
- name: Build and Install
run: |
cmake -S . -B build -G "${{ matrix.generator }}" -D PICO_SDK_PATH="${{ github.workspace }}/pico-sdk" ${{ !matrix.libusb && '-D PICOTOOL_NO_LIBUSB=1' || '' }} ${{ matrix.compile && '-D USE_PRECOMPILED=false' || '' }}
cmake --build build
${{ runner.os != 'Windows' && 'sudo' || '' }} cmake --install build --config Debug
- name: Add to path (Windows)
if: runner.os == 'Windows'
run: echo "C:\Program Files (x86)\picotool\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test
run: |
picotool help
curl -L https://datasheets.raspberrypi.com/soft/blink.uf2 -o blink.uf2
unzip -o blink.uf2 || true
curl -L https://datasheets.raspberrypi.com/soft/hello_world.uf2 -o hello_world.uf2
unzip -o hello_world.uf2 || true
curl -L https://datasheets.raspberrypi.com/soft/flash_nuke.uf2 -o flash_nuke.uf2
unzip -o flash_nuke.uf2 || true
picotool info -a blink.uf2
picotool info -a hello_world.uf2
picotool info -a flash_nuke.uf2
- name: Test libusb compiled
if: matrix.libusb == 'libusb'
run: |
picotool help load
picotool help save
picotool help erase
test-examples:
# Prevent running twice for PRs from same repo
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Test Build Examples
strategy:
fail-fast: false
matrix:
compiler: ["gcc", "clang"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt install cmake ninja-build python3 build-essential libusb-1.0-0-dev
- name: Install GCC
if: matrix.compiler == 'gcc'
run: sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
- name: Install Clang
if: matrix.compiler == 'clang'
uses: stellar-aria/llvm-embedded-toolchain-for-arm-action@latest
- name: Checkout Pico SDK
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk
submodules: 'recursive'
- name: Build and Install
run: |
cmake -S . -B build -G "Ninja" -D PICO_SDK_PATH="${{ github.workspace }}/pico-sdk"
cmake --build build
sudo cmake --install build
- name: Checkout Pico Examples
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-examples
ref: develop
path: pico-examples
- name: Build Pico Examples
run: |
cmake -S pico-examples -B build-examples -G "Ninja" -D PICO_SDK_PATH="${{ github.workspace }}/pico-sdk" -D PICO_BOARD=pico2_w ${{ matrix.compiler == 'clang' && '-D PICO_COMPILER=pico_arm_clang' || '' }}
cmake --build build-examples
test-older-sdk:
# Due to 2.1.0 and 2.1.1 pointing at the develop tag (https://github.com/raspberrypi/pico-sdk/pull/2401)
# This test can be removed once 2.1.0 and 2.1.1 are no longer supported (use 2.1.x-correct-picotool instead)
# Prevent running twice for PRs from same repo
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
fail-fast: false
matrix:
sdk: ["2.1.1", "2.1.0"]
name: Test Build with older SDK
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
# No libusb, as that is how the SDK auto-builds picotool
run: sudo apt install cmake ninja-build python3 build-essential
- name: Checkout Pico SDK
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
ref: ${{ matrix.sdk }}
path: pico-sdk
submodules: 'recursive'
- name: Build and Install
run: |
cmake -S . -B build -G "Ninja" -D PICO_SDK_PATH="${{ github.workspace }}/pico-sdk" -D PICOTOOL_NO_LIBUSB=1
cmake --build build
sudo cmake --install build
- name: Test
run: |
picotool version ${{ matrix.sdk }}