12
12
jobs :
13
13
build_windows :
14
14
name : Build Windows
15
- # runs-on: [self-hosted, Windows, x64]
16
15
runs-on : ' windows-latest'
17
16
18
17
steps :
19
18
- name : Checkout
20
19
uses : actions/checkout@v4
21
- # - name: Setup SSH Auth
22
- # if: runner.environment == 'github-hosted'
23
- # uses: webfactory/[email protected]
24
- # with:
25
- # ssh-private-key: ${{ secrets.SSH_KEY }}
26
20
- name : Setup MSYS2
27
21
uses : msys2/setup-msys2@v2
28
22
- name : Build
33
27
- name : Upload Artifact
34
28
uses : actions/upload-artifact@v4
35
29
with :
36
- name : tools-x64- win
30
+ name : tools-win-${{ runner.arch }}
37
31
path : |
38
32
bin/picotool-*-x64-win.zip
39
33
bin/pico-sdk-tools-*-x64-win.zip
@@ -49,38 +43,41 @@ jobs:
49
43
bin/openocd-*-x64-win.zip
50
44
bin/riscv-toolchain-*-x64-win.zip
51
45
52
- build_macos_arm64 :
53
- name : Build MacOS Arm64
54
- # runs-on: [self-hosted, macOS]
46
+ build_macos :
47
+ name : Build MacOS
55
48
runs-on : ' macos-14'
56
49
57
50
steps :
58
51
- name : Checkout
59
52
uses : actions/checkout@v4
60
- - name : Set up Homebrew
61
- if : runner.environment == 'github-hosted'
53
+ - name : Set up arm64 Homebrew
62
54
id : set-up-homebrew
63
55
uses : Homebrew/actions/setup-homebrew@master
56
+ - name : Build arm64
57
+ run : ./build_macos.sh
58
+ - name : Uninstall arm64 Homebrew
59
+ run : |
60
+ NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
61
+ rm -rf /opt/homebrew || true
64
62
- name : Set up x86_64 Homebrew
65
- if : runner.environment == 'github-hosted'
66
63
run : |
67
64
NONINTERACTIVE=1 arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
68
- # - name: Setup SSH Auth
69
- # if: runner.environment == 'github-hosted'
70
- # uses: webfactory/[email protected]
71
- # with:
72
- # ssh-private-key: ${{ secrets.SSH_KEY }}
73
- - name : Build
74
- run : ./build_macos .sh
65
+ - name : Install x86_64 pkg-config & cmake
66
+ run : |
67
+ arch -x86_64 /usr/local/bin/brew install pkg-config cmake
68
+ - name : Build x86_64
69
+ run : arch -x86_64 ./build_macos.sh
70
+ - name : Merge Universal Binaries
71
+ run : ./merge_macos .sh
75
72
- name : Upload Artifact
76
73
uses : actions/upload-artifact@v4
77
74
with :
78
- name : tools-mac-arm64
75
+ name : tools-mac-universal
79
76
path : |
80
77
bin/picotool-*-mac.zip
81
78
bin/pico-sdk-tools-*-mac.zip
82
79
bin/openocd-*-mac.zip
83
- bin/riscv-toolchain-*.zip
80
+ bin/riscv-toolchain-*-mac .zip
84
81
- name : Add Release Asset
85
82
uses : softprops/action-gh-release@v2
86
83
if : startsWith(github.ref, 'refs/tags/')
@@ -89,57 +86,19 @@ jobs:
89
86
bin/picotool-*-mac.zip
90
87
bin/pico-sdk-tools-*-mac.zip
91
88
bin/openocd-*-mac.zip
92
- bin/riscv-toolchain-*.zip
93
-
94
- build_macos_x64 :
95
- name : Build MacOS x64
96
- runs-on : ' macos-13'
97
- env :
98
- # Universal picotool is built on arm64
99
- SKIP_PICOTOOL : 1
100
-
101
- steps :
102
- - name : Checkout
103
- uses : actions/checkout@v4
104
- - name : Set up Homebrew
105
- if : runner.environment == 'github-hosted'
106
- id : set-up-homebrew
107
- uses : Homebrew/actions/setup-homebrew@master
108
- - name : Build
109
- run : ./build_macos.sh
110
- - name : Upload Artifact
111
- uses : actions/upload-artifact@v4
112
- with :
113
- name : tools-mac-x64
114
- path : |
115
- bin/openocd-*-mac.zip
116
- bin/riscv-toolchain-*.zip
117
- - name : Add Release Asset
118
- uses : softprops/action-gh-release@v2
119
- if : startsWith(github.ref, 'refs/tags/')
120
- with :
121
- files : |
122
- bin/openocd-*-mac.zip
123
- bin/riscv-toolchain-*.zip
89
+ bin/riscv-toolchain-*-mac.zip
124
90
125
91
build_linux :
126
92
name : Build Linux
127
- # strategy:
128
- # matrix:
129
- # os: [[self-hosted, linux, x64], [self-hosted, linux, arm64]]
130
93
strategy :
94
+ fail-fast : false
131
95
matrix :
132
- os : [ubuntu-22.04, [self-hosted, linux, arm64]]
96
+ os : [ubuntu-22.04, [self-hosted, linux, arm64, bookworm, 8G ]]
133
97
runs-on : ${{ matrix.os }}
134
98
135
99
steps :
136
100
- name : Checkout
137
101
uses : actions/checkout@v4
138
- # - name: Setup SSH Auth
139
- # if: runner.environment == 'github-hosted'
140
- # uses: webfactory/[email protected]
141
- # with:
142
- # ssh-private-key: ${{ secrets.SSH_KEY }}
143
102
- name : Build
144
103
run : ./build_linux.sh
145
104
- name : Upload Artifact
@@ -161,3 +120,77 @@ jobs:
161
120
bin/openocd-*-lin.tar.gz
162
121
bin/riscv-toolchain-*-lin.tar.gz
163
122
123
+ test_binaries :
124
+ name : Test Binaries
125
+ needs : [build_linux, build_macos, build_windows]
126
+ if : always() && contains(needs.*.result, 'success')
127
+ strategy :
128
+ fail-fast : false
129
+ matrix :
130
+ # Test all GitHub supported versions, except for windows-11-arm
131
+ os : [macos-15, macos-15-intel, macos-14, windows-2025, windows-2022, windows-11-arm, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm, ubuntu-22.04-arm, [self-hosted, linux, arm64, trixie_desktop], [self-hosted, linux, arm64, bookworm_desktop]]
132
+ runs-on : ${{ matrix.os }}
133
+ steps :
134
+ - name : Download build (Windows)
135
+ if : runner.os == 'Windows'
136
+ uses : actions/download-artifact@v5
137
+ with :
138
+ # Only built for x64, but arm should still run it fine
139
+ name : tools-win-X64
140
+ - name : Download build (MacOS)
141
+ if : runner.os == 'macOS'
142
+ uses : actions/download-artifact@v5
143
+ with :
144
+ name : tools-mac-universal
145
+ - name : Download build (Linux)
146
+ if : runner.os == 'Linux'
147
+ uses : actions/download-artifact@v5
148
+ with :
149
+ name : tools-lin-${{ runner.arch }}
150
+
151
+ - name : Extract build (zip)
152
+ if : runner.os == 'Windows' || runner.os == 'macOS'
153
+ shell : bash # Windows only has unzip in bash shell
154
+ run : |
155
+ unzip -o pico-sdk-tools*.zip
156
+ ls
157
+ unzip -o picotool*.zip
158
+ ls
159
+ unzip -o openocd*.zip || true
160
+ ls
161
+ unzip -o riscv-toolchain*.zip || true
162
+ ls
163
+ - name : Extract build (tar.gz)
164
+ if : runner.os == 'Linux'
165
+ run : |
166
+ tar -xvf pico-sdk-tools*.tar.gz
167
+ ls
168
+ tar -xvf picotool*.tar.gz
169
+ ls
170
+ tar -xvf openocd*.tar.gz || true
171
+ ls
172
+ tar -xvf riscv-toolchain*.tar.gz || true
173
+ ls
174
+
175
+ - name : Clean runner (MacOS)
176
+ if : runner.os == 'macOS'
177
+ run : |
178
+ NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
179
+ - name : Install prerequisites (Ubuntu)
180
+ if : runner.os == 'Linux' && runner.environment == 'github-hosted'
181
+ run : sudo apt install libftdi1-2 libhidapi-hidraw0
182
+
183
+ - name : Test default stuff runs
184
+ run : |
185
+ ./picotool/picotool version
186
+ ./pioasm/pioasm --version
187
+ - name : Test openocd runs
188
+ if : env.SKIP_OPENOCD != 1
189
+ run : |
190
+ ./openocd --version
191
+ - name : Test riscv-toolchain runs
192
+ if : env.SKIP_RISCV != 1
193
+ run : |
194
+ ./bin/riscv32-unknown-elf-gcc --version
195
+ ./bin/riscv32-unknown-elf-gdb --version
196
+
0 commit comments