@@ -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 cython3 -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 "sphinx-autoapi<=3.3.2" --break-system-packages
48+
3849jobs :
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 :
50- - uses : actions/checkout@v4.1.1
68+ - uses : actions/checkout@v4.2.2
5169
5270 - name : Build sources and run tests
53- uses : uraimo/run-on-arch-action@v2.6 .0
71+ uses : uraimo/run-on-arch-action@v3.0 .0
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,20 +93,58 @@ 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 }}
97+
98+ # Build a wheel, install it for running unit tests.
99+ # pip does not know that ninja is installed, and tries to install it again.
100+ # so pass --ignore-dep ninja explicitly
101+ run : |
102+ echo "\nBuilding and installing pygame wheel\n"
103+ PIP_BREAK_SYSTEM_PACKAGES=1 python3 dev.py --ignore-dep ninja build --wheel /artifacts --lax
104+ echo "\nRunning tests\n"
105+ export SDL_VIDEODRIVER=dummy
106+ export SDL_AUDIODRIVER=disk
107+ python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
108+
109+ # Upload the generated files under github actions assets section
110+ - name : Upload dist
111+ uses : actions/upload-artifact@v4
112+ with :
113+ name : pygame-multiarch-${{ matrix.arch }}-dist
114+ path : ~/artifacts/*.whl
82115
83- # Build a wheel, install it for running unit tests
116+ # test wheels built on armv7 on armv6. Why?
117+ # because piwheels expects the same armv7 wheel to work on both armv7 and armv6
118+ test-armv7-on-armv6 :
119+ needs : build-multiarch
120+ name : Debian (Bookworm - 12) [build - armv7, test - armv6]
121+ runs-on : ubuntu-22.04
122+ steps :
123+ - name : Download all multiarch artifacts
124+ uses : actions/download-artifact@v4
125+ with :
126+ name : pygame-multiarch-armv7-dist
127+ path : ~/artifacts
128+
129+ - name : Rename arm wheel in artifacts
130+ run : |
131+ cd ~/artifacts
132+ for f in *; do
133+ mv "$f" "${f//armv7l/armv6l}"
134+ done
135+
136+ - name : Test armv7 wheel on armv6
137+ uses : uraimo/run-on-arch-action@v3.0.0
138+ with :
139+ arch : armv6
140+ distro : bookworm
141+ githubToken : ${{ github.token }}
142+ dockerRunArgs : --volume ~/artifacts:/artifacts_new
143+ shell : /bin/sh
144+ install : ${{ env.INSTALL_CMD }}
84145 run : |
85- export PIP_CONFIG_FILE=buildconfig/pip_config.ini
86- echo "\nBuilding pygame wheel\n"
87- python3 setup.py docs
88- pip3 wheel . --wheel-dir /artifacts -vvv
89146 echo "\nInstalling wheel\n"
90- pip3 install --no-index --pre --find-links /artifacts pygame-ce
147+ pip3 install --no-index --pre --break-system-packages -- find-links /artifacts_new pygame-ce
91148 echo "\nRunning tests\n"
92149 export SDL_VIDEODRIVER=dummy
93150 export SDL_AUDIODRIVER=disk
0 commit comments