-
Notifications
You must be signed in to change notification settings - Fork 29
129 lines (115 loc) · 4 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Docker images
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.image }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
# Run slower jobs first to give them a headstart and reduce waiting time
- "ubuntu-22.04-jammy-arm64v8"
- "ubuntu-24.04-noble-ppc64le"
- "ubuntu-24.04-noble-s390x"
# test image for manylinux-wheel build
- "ubuntu-24.04-noble-amd64"
# Then run the remainder
- "alpine"
- "amazon-2-amd64"
- "amazon-2023-amd64"
- "arch"
- "centos-stream-9-amd64"
- "centos-stream-10-amd64"
- "debian-12-bookworm-x86"
- "debian-12-bookworm-amd64"
- "fedora-40-amd64"
- "fedora-41-amd64"
- "gentoo"
- "ubuntu-22.04-jammy-amd64"
- "ubuntu-22.04-jammy-amd64-valgrind"
# has a dependency on the test image
- "manylinux2014-wheel-build"
- "manylinux_2_28-wheel-build"
include:
- image: "manylinux2014-wheel-build"
test-image: "fedora-41-amd64"
- image: "manylinux_2_28-wheel-build"
test-image: "fedora-41-amd64"
- image: "ubuntu-22.04-jammy-arm64v8"
qemu-arch: "aarch64"
docker-args: "--platform linux/arm64"
- image: "ubuntu-24.04-noble-ppc64le"
qemu-arch: "ppc64le"
docker-args: "--platform linux/ppc64le"
- image: "ubuntu-24.04-noble-s390x"
qemu-arch: "s390x"
docker-args: "--platform linux/s390x"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: true
- name: Set up QEMU
if: "matrix.qemu-arch"
run: |
docker run --rm --privileged aptman/qus -s -- -p ${{ matrix.qemu-arch }}
- name: Prepare build
run: |
sudo apt-get update && sudo apt-get install -qyy debootstrap
if [[ -n "$matrix.test-image" ]]; then
git submodule update --remote --init --recursive Pillow
else
git submodule update --remote Pillow
fi
(cd Pillow && git checkout main)
sudo chown -R 1001 $(pwd)
- name: Test Image Build
if: "matrix.test-image"
run: |
cd "${{ matrix.test-image }}"
make pull || (sudo chmod a+w . && make update && make build BRANCH=main)
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_ARGS: ${{ matrix.docker-args }}
- name: Build image
id: build
run: |
cd "${{ matrix.image }}" && sudo chmod a+w . && make update
if [[ -n "$DOCKER_USERNAME" ]]; then
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin && echo "logged_in=true" >> $GITHUB_OUTPUT
fi
make build BRANCH=main
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_ARGS: ${{ matrix.docker-args }}
- name: Test image
run: |
cd "${{ matrix.image }}"
make test BRANCH=main
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Log image size
run: |
docker images
- name: Push image
if: "steps.build.outputs.logged_in == 'true'
&& github.event_name == 'push'
&& github.ref == 'refs/heads/main'"
run: make push-${{ matrix.image }} BRANCH=main
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: Post build
if: always()
run: sudo chown -R $(id -u) $(pwd)
success:
needs: build
runs-on: ubuntu-latest
name: Build successful
steps:
- name: Success
run: echo Build Successful