1212jobs :
1313 build_windows :
1414 name : Build Windows
15- # runs-on: [self-hosted, Windows, x64]
1615 runs-on : ' windows-latest'
1716
1817 steps :
1918 - name : Checkout
2019 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 }}
2620 - name : Setup MSYS2
2721 uses : msys2/setup-msys2@v2
2822 - name : Build
3327 - name : Upload Artifact
3428 uses : actions/upload-artifact@v4
3529 with :
36- name : tools-x64- win
30+ name : tools-win-${{ runner.arch }}
3731 path : |
3832 bin/picotool-*-x64-win.zip
3933 bin/pico-sdk-tools-*-x64-win.zip
@@ -49,38 +43,41 @@ jobs:
4943 bin/openocd-*-x64-win.zip
5044 bin/riscv-toolchain-*-x64-win.zip
5145
52- build_macos_arm64 :
53- name : Build MacOS Arm64
54- # runs-on: [self-hosted, macOS]
46+ build_macos :
47+ name : Build MacOS
5548 runs-on : ' macos-14'
5649
5750 steps :
5851 - name : Checkout
5952 uses : actions/checkout@v4
60- - name : Set up Homebrew
61- if : runner.environment == 'github-hosted'
53+ - name : Set up arm64 Homebrew
6254 id : set-up-homebrew
6355 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
6462 - name : Set up x86_64 Homebrew
65- if : runner.environment == 'github-hosted'
6663 run : |
6764 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
7572 - name : Upload Artifact
7673 uses : actions/upload-artifact@v4
7774 with :
78- name : tools-mac-arm64
75+ name : tools-mac-universal
7976 path : |
8077 bin/picotool-*-mac.zip
8178 bin/pico-sdk-tools-*-mac.zip
8279 bin/openocd-*-mac.zip
83- bin/riscv-toolchain-*.zip
80+ bin/riscv-toolchain-*-mac .zip
8481 - name : Add Release Asset
8582 uses : softprops/action-gh-release@v2
8683 if : startsWith(github.ref, 'refs/tags/')
@@ -89,57 +86,19 @@ jobs:
8986 bin/picotool-*-mac.zip
9087 bin/pico-sdk-tools-*-mac.zip
9188 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
12490
12591 build_linux :
12692 name : Build Linux
127- # strategy:
128- # matrix:
129- # os: [[self-hosted, linux, x64], [self-hosted, linux, arm64]]
13093 strategy :
94+ fail-fast : false
13195 matrix :
132- os : [ubuntu-22.04, [self-hosted, linux, arm64]]
96+ os : [ubuntu-22.04, [self-hosted, linux, arm64, bookworm, 8G ]]
13397 runs-on : ${{ matrix.os }}
13498
13599 steps :
136100 - name : Checkout
137101 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 }}
143102 - name : Build
144103 run : ./build_linux.sh
145104 - name : Upload Artifact
@@ -161,3 +120,77 @@ jobs:
161120 bin/openocd-*-lin.tar.gz
162121 bin/riscv-toolchain-*-lin.tar.gz
163122
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