Skip to content

Commit f6d5a9d

Browse files
committed
Add armv6 and armv7 to multiarch CI
- bumps the multiarch action - bumps to bookworm - armv6 and armv7 testing added (image based on raspbian) - also adds the ability to test an armv7 built wheel on armv6
1 parent 4b8df62 commit f6d5a9d

File tree

1 file changed

+74
-13
lines changed

1 file changed

+74
-13
lines changed

.github/workflows/build-debian-multiarch.yml

+74-13
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,45 @@ concurrency:
3535
group: ${{ github.workflow }}-${{ github.ref }}-debian-multiarch
3636
cancel-in-progress: true
3737

38+
# this command is called in two places, so save it in an env first
39+
env:
40+
INSTALL_CMD: |
41+
apt-get update --fix-missing
42+
apt-get upgrade -y
43+
apt-get install build-essential meson -y
44+
apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev -y
45+
apt-get install libfreetype6-dev libportmidi-dev fontconfig -y
46+
apt-get install python3-dev python3-pip python3-wheel python3-sphinx -y
47+
pip3 install meson-python --break-system-packages
48+
3849
jobs:
3950
build-multiarch:
40-
name: Debian (Bullseye - 11) [${{ matrix.arch }}]
51+
name: Debian (Bookworm - 12) [${{ matrix.arch }}]
4152
runs-on: ubuntu-22.04
4253

4354
strategy:
4455
fail-fast: false # if a particular matrix build fails, don't skip the rest
4556
matrix:
4657
# maybe more things could be added in here in the future (if needed)
47-
arch: [s390x, ppc64le]
58+
include:
59+
- { arch: s390x, base_image: '' }
60+
- { arch: ppc64le, base_image: '' }
61+
- { arch: armv6, base_image: '' }
62+
# a custom base_image is specified in the armv7 case. This is done because
63+
# the armv6 image is just raspbian in disguise. And the wheel built on armv7
64+
# is going to be tested on armv6
65+
- { arch: armv7, base_image: 'balenalib/raspberrypi3-debian:bookworm' }
4866

4967
steps:
5068
- uses: actions/[email protected]
5169

5270
- name: Build sources and run tests
53-
uses: uraimo/[email protected].1
71+
uses: uraimo/[email protected].2
5472
id: build
5573
with:
56-
arch: ${{ matrix.arch }}
57-
distro: bullseye
74+
arch: ${{ matrix.base_image && 'none' || matrix.arch }}
75+
distro: ${{ matrix.base_image && 'none' || 'bookworm' }}
76+
base_image: ${{ matrix.base_image }}
5877

5978
# Not required, but speeds up builds
6079
githubToken: ${{ github.token }}
@@ -74,19 +93,61 @@ jobs:
7493
# builds don't have to re-install them. The image layer is cached
7594
# publicly in your project's package repository, so it is vital that
7695
# no secrets are present in the container state or logs.
77-
install: |
78-
apt-get update --fix-missing
79-
apt-get upgrade -y
80-
apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev fontconfig -y
81-
apt-get install python3-setuptools python3-dev python3-pip python3-wheel python3-sphinx -y
96+
install: ${{ env.INSTALL_CMD }}
8297

83-
# Build a wheel, install it for running unit tests
98+
# Build a wheel, install it for running unit tests.
99+
# --no-build-isolation is passed so that preinstalled meson-python can be used
100+
# (done for optimization reasons)
84101
run: |
85102
echo "\nBuilding pygame wheel\n"
86103
python3 setup.py docs
87-
pip3 wheel . --wheel-dir /artifacts -vvv
104+
pip3 wheel . --no-build-isolation --wheel-dir /artifacts -vvv
105+
echo "\nInstalling wheel\n"
106+
pip3 install --no-index --pre --break-system-packages --find-links /artifacts pygame-ce
107+
echo "\nRunning tests\n"
108+
export SDL_VIDEODRIVER=dummy
109+
export SDL_AUDIODRIVER=disk
110+
python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
111+
112+
# Upload the generated files under github actions assets section
113+
- name: Upload dist
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: pygame-multiarch-${{ matrix.arch }}-dist
117+
path: ~/artifacts/*.whl
118+
119+
# test wheels built on armv7 on armv6. Why?
120+
# because piwheels expects the same armv7 wheel to work on both armv7 and armv6
121+
test-armv7-on-armv6:
122+
needs: build-multiarch
123+
name: Debian (Bookworm - 12) [build - armv7, test - armv6]
124+
runs-on: ubuntu-22.04
125+
steps:
126+
- name: Download all multiarch artifacts
127+
uses: actions/download-artifact@v4
128+
with:
129+
name: pygame-multiarch-armv7-dist
130+
path: ~/artifacts
131+
132+
- name: Rename arm wheel in artifacts
133+
run: |
134+
cd ~/artifacts
135+
for f in *; do
136+
mv "$f" "${f//armv7l/armv6l}"
137+
done
138+
139+
- name: Test armv7 wheel on armv6
140+
uses: uraimo/[email protected]
141+
with:
142+
arch: armv6
143+
distro: bookworm
144+
githubToken: ${{ github.token }}
145+
dockerRunArgs: --volume ~/artifacts:/artifacts_new
146+
shell: /bin/sh
147+
install: ${{ env.INSTALL_CMD }}
148+
run: |
88149
echo "\nInstalling wheel\n"
89-
pip3 install --no-index --pre --find-links /artifacts pygame-ce
150+
pip3 install --no-index --pre --break-system-packages --find-links /artifacts_new pygame-ce
90151
echo "\nRunning tests\n"
91152
export SDL_VIDEODRIVER=dummy
92153
export SDL_AUDIODRIVER=disk

0 commit comments

Comments
 (0)