Skip to content

Commit c342e31

Browse files
authored
moved actions from QEMU to GH Arm64 runners (#331)
moved some tests/wheels actions from QEMU to GH Arm64 runners
1 parent 7cceac4 commit c342e31

7 files changed

+274
-104
lines changed

.github/workflows/build-cache-deps.yml

+106-21
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: [master]
66
paths:
77
- '.github/workflows/build-cache-deps.yml'
8-
- 'docker/*_armv7l_wheels.Dockerfile'
98
- 'libheif/linux/**'
109
- 'libheif/linux_*.py'
1110
- 'setup.py'
@@ -18,26 +17,66 @@ concurrency:
1817
cancel-in-progress: true
1918

2019
jobs:
21-
dependencies_linux:
20+
dependencies_linux_amd64:
2221
strategy:
2322
fail-fast: true
2423
matrix:
2524
cibw_buildlinux: [ manylinux, musllinux ]
26-
cibw_arch: [ "aarch64", "x86_64" ]
27-
name: ${{ matrix.cibw_arch }} • ${{ matrix.cibw_buildlinux }}
28-
runs-on: ubuntu-20.04
25+
name: AMD64 • ${{ matrix.cibw_buildlinux }}
26+
runs-on: ubuntu-24.04
2927
env:
30-
KEY_HEAD: ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
28+
KEY_HEAD: x86_64-${{ matrix.cibw_buildlinux }}
3129
BUILD_DIR: "/tmp/ph_build_stuff"
3230

3331
steps:
3432
- uses: actions/checkout@v4
35-
- name: Set up QEMU
36-
if: matrix.cibw_arch == 'aarch64'
37-
uses: docker/setup-qemu-action@v3
33+
- name: Install cibuildwheel & twine
34+
run: python3 -m pip install twine cibuildwheel==2.21.3
35+
36+
- uses: actions/cache@v4
3837
with:
39-
platforms: arm64
38+
path: ${{ env.BUILD_DIR }}
39+
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
40+
env:
41+
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
42+
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}
43+
44+
- name: Start test build
45+
run: cibuildwheel
46+
env:
47+
CIBW_BUILD: ${{ format('cp39-{0}*', matrix.cibw_buildlinux) }}
48+
CIBW_ARCHS: "x86_64"
49+
CIBW_BEFORE_ALL_LINUX: |
50+
python3 {package}/libheif/linux_build_libs.py
51+
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_FULL_ACTION=1
52+
CIBW_BUILD_VERBOSITY: 1
4053

54+
- name: Checking built wheels
55+
run: twine check wheelhouse/*
56+
57+
- name: Uploading wheels
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: wheels
61+
path: wheelhouse/*.whl
62+
if-no-files-found: error
63+
64+
- name: Fix cache permissions
65+
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}
66+
67+
dependencies_linux_arm64:
68+
strategy:
69+
fail-fast: true
70+
matrix:
71+
cibw_buildlinux: [ manylinux, musllinux ]
72+
name: ARM64 • ${{ matrix.cibw_buildlinux }}
73+
runs-on: ubuntu-24.04-arm
74+
env:
75+
KEY_HEAD: aarch64-${{ matrix.cibw_buildlinux }}
76+
BUILD_DIR: "/tmp/ph_build_stuff"
77+
78+
steps:
79+
- uses: actions/checkout@v4
4180
- name: Install cibuildwheel & twine
4281
run: python3 -m pip install twine cibuildwheel==2.21.3
4382

@@ -53,7 +92,7 @@ jobs:
5392
run: cibuildwheel
5493
env:
5594
CIBW_BUILD: ${{ format('cp39-{0}*', matrix.cibw_buildlinux) }}
56-
CIBW_ARCHS: ${{ matrix.cibw_arch }}
95+
CIBW_ARCHS: "aarch64"
5796
CIBW_BEFORE_ALL_LINUX: |
5897
python3 {package}/libheif/linux_build_libs.py
5998
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_FULL_ACTION=1
@@ -72,16 +111,15 @@ jobs:
72111
- name: Fix cache permissions
73112
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}
74113

75-
pi_heif_dependencies_linux:
114+
pi_heif_dependencies_linux_amd64:
76115
strategy:
77116
fail-fast: true
78117
matrix:
79118
cibw_buildlinux: [ manylinux, musllinux ]
80-
cibw_arch: [ "aarch64", "x86_64" ]
81-
name: Pi-Heif • ${{ matrix.cibw_arch }} • ${{ matrix.cibw_buildlinux }}
82-
runs-on: ubuntu-20.04
119+
name: Pi-Heif • AMD64 • ${{ matrix.cibw_buildlinux }}
120+
runs-on: ubuntu-24.04
83121
env:
84-
KEY_HEAD: Pi-Heif-${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
122+
KEY_HEAD: Pi-Heif-x86_64-${{ matrix.cibw_buildlinux }}
85123
BUILD_DIR: "/tmp/ph_build_stuff"
86124

87125
steps:
@@ -91,11 +129,58 @@ jobs:
91129
cp -r -v ./pi-heif/* .
92130
python3 .github/transform_to-pi_heif.py
93131
94-
- name: Set up QEMU
95-
if: matrix.cibw_arch == 'aarch64'
96-
uses: docker/setup-qemu-action@v3
132+
- name: Install cibuildwheel & twine
133+
run: python3 -m pip install twine cibuildwheel==2.21.3
134+
135+
- uses: actions/cache@v4
97136
with:
98-
platforms: arm64
137+
path: ${{ env.BUILD_DIR }}
138+
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
139+
env:
140+
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
141+
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}
142+
143+
- name: Start test build
144+
run: cibuildwheel
145+
env:
146+
CIBW_BUILD: ${{ format('cp39-{0}*', matrix.cibw_buildlinux) }}
147+
CIBW_ARCHS: "x86_64"
148+
CIBW_BEFORE_ALL_LINUX: |
149+
${{ env.INSTALL_OS_PACKAGES }}
150+
python3 {package}/libheif/linux_build_libs.py
151+
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_LIGHT_ACTION=1
152+
CIBW_BUILD_VERBOSITY: 1
153+
154+
- name: Checking built wheels
155+
run: twine check wheelhouse/*
156+
157+
- name: Uploading wheels
158+
uses: actions/upload-artifact@v3
159+
with:
160+
name: wheels
161+
path: wheelhouse/*.whl
162+
if-no-files-found: error
163+
164+
- name: Fix cache permissions
165+
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}
166+
167+
pi_heif_dependencies_linux_arm64:
168+
strategy:
169+
fail-fast: true
170+
matrix:
171+
cibw_buildlinux: [ manylinux, musllinux ]
172+
name: Pi-Heif • ARM64 • ${{ matrix.cibw_buildlinux }}
173+
runs-on: ubuntu-24.04-arm
174+
env:
175+
KEY_HEAD: Pi-Heif-aarch64-${{ matrix.cibw_buildlinux }}
176+
BUILD_DIR: "/tmp/ph_build_stuff"
177+
178+
steps:
179+
- uses: actions/checkout@v4
180+
- name: Transform to Pi-Heif
181+
run: |
182+
cp -r -v ./pi-heif/* .
183+
python3 .github/transform_to-pi_heif.py
99184
100185
- name: Install cibuildwheel & twine
101186
run: python3 -m pip install twine cibuildwheel==2.21.3
@@ -112,7 +197,7 @@ jobs:
112197
run: cibuildwheel
113198
env:
114199
CIBW_BUILD: ${{ format('cp39-{0}*', matrix.cibw_buildlinux) }}
115-
CIBW_ARCHS: ${{ matrix.cibw_arch }}
200+
CIBW_ARCHS: "aarch64"
116201
CIBW_BEFORE_ALL_LINUX: |
117202
${{ env.INSTALL_OS_PACKAGES }}
118203
python3 {package}/libheif/linux_build_libs.py

.github/workflows/test-src-build-linux.yml

+45-16
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,18 @@ concurrency:
2828
cancel-in-progress: true
2929

3030
jobs:
31-
full_linux:
32-
name: ${{ matrix.docker_file }}-${{ matrix.arch }}
31+
linux_amd64:
32+
name: AMD64 • ${{ matrix.docker_file }}
3333
runs-on: ubuntu-latest
3434

3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
arch: ["amd64", "arm64"]
39-
docker_file: ["Alpine_3_19", "Alpine_3_20", "Almalinux_9", "Debian_12"]
40-
# include:
41-
# - arch: "amd64"
42-
# docker_file: "Archlinux"
43-
# - arch: "amd64"
44-
# docker_file: "Fedora_39"
38+
docker_file: ["Alpine_3_20", "Alpine_3_21", "Almalinux_9", "Debian_12"]
39+
# docker_file: ["Alpine_3_20", "Alpine_3_21", "Almalinux_9", "Debian_12", "Archlinux", "Fedora_39"]
4540

4641
steps:
4742
- uses: actions/checkout@v4
48-
- name: Set up QEMU
49-
uses: docker/setup-qemu-action@v3
5043

5144
- name: Setup Docker Buildx
5245
uses: docker/setup-buildx-action@v3
@@ -56,18 +49,54 @@ jobs:
5649
with:
5750
context: .
5851
file: docker/from_src/${{ matrix.docker_file }}.Dockerfile
59-
platforms: linux/${{ matrix.arch }}
52+
platforms: linux/amd64
6053
push: false
61-
cache-from: type=gha,scope=${{ matrix.docker_file }}-${{ matrix.arch }}
62-
cache-to: type=gha,mode=min,scope=${{ matrix.docker_file }}-${{ matrix.arch }}
54+
cache-from: type=gha,scope=${{ matrix.docker_file }}-amd64
55+
cache-to: type=gha,mode=min,scope=${{ matrix.docker_file }}-amd64
6356
target: base
6457

6558
- name: Build & Test Pillow-Heif
6659
uses: docker/build-push-action@v6
6760
with:
6861
context: .
6962
file: docker/from_src/${{ matrix.docker_file }}.Dockerfile
70-
platforms: linux/${{ matrix.arch }}
63+
platforms: linux/amd64
7164
push: false
72-
cache-from: type=gha,scope=${{ matrix.docker_file }}-${{ matrix.arch }}
65+
cache-from: type=gha,scope=${{ matrix.docker_file }}-amd64
66+
target: build_test
67+
68+
linux_arm64:
69+
name: ARM64 • ${{ matrix.docker_file }}
70+
runs-on: ubuntu-24.04-arm
71+
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
docker_file: ["Alpine_3_20", "Alpine_3_21", "Almalinux_9", "Debian_12"]
76+
77+
steps:
78+
- uses: actions/checkout@v4
79+
80+
- name: Setup Docker Buildx
81+
uses: docker/setup-buildx-action@v3
82+
83+
- name: Build Requirements
84+
uses: docker/build-push-action@v6
85+
with:
86+
context: .
87+
file: docker/from_src/${{ matrix.docker_file }}.Dockerfile
88+
platforms: linux/arm64
89+
push: false
90+
cache-from: type=gha,scope=${{ matrix.docker_file }}-arm64
91+
cache-to: type=gha,mode=min,scope=${{ matrix.docker_file }}-arm64
92+
target: base
93+
94+
- name: Build & Test Pillow-Heif
95+
uses: docker/build-push-action@v6
96+
with:
97+
context: .
98+
file: docker/from_src/${{ matrix.docker_file }}.Dockerfile
99+
platforms: linux/arm64
100+
push: false
101+
cache-from: type=gha,scope=${{ matrix.docker_file }}-arm64
73102
target: build_test

0 commit comments

Comments
 (0)