8282 name : Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }}
8383 runs-on : ubuntu-20.04
8484 env :
85- BUILD_STUFF : " /build-stuff"
86- SCRIPTS : " ./build_scripts/linux/"
87- BUILD_ORDER : " pkg-config,nasm,libde265,aom,libheif,libffi"
85+ BUILD_DIR_PREFIX : " /tmp/pillow_heif"
8886 KEY_HEAD : ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
8987
9088 steps :
@@ -95,80 +93,39 @@ jobs:
9593 with :
9694 platforms : arm64
9795
98- - name : Preparations
99- run : |
100- sudo mkdir "$BUILD_STUFF" && sudo chmod 777 "$BUILD_STUFF"
101- echo BUILD_STUFF_CMD="&& sh $(echo "$BUILD_ORDER" | sed 's/,/.sh \&\& sh /g').sh" >> $GITHUB_ENV
102- python3 -m pip install cibuildwheel twine
96+ - name : Install cibuildwheel & twine
97+ run : python3 -m pip install cibuildwheel twine
10398
10499 - name : manylinux preparations
105100 if : matrix.cibw_buildlinux == 'manylinux'
106- run : |
107- echo BUILD_COMMAND="yum install -y -q $OS_PACKAGES && set -ex && cd $SCRIPTS $BUILD_STUFF_CMD" >> $GITHUB_ENV
108- echo LDCONFIG_ARG="" >> $GITHUB_ENV
101+ run : echo INSTALL_OS_PACKAGES="yum update -y && yum install -y $OS_PACKAGES" >> $GITHUB_ENV
109102 env :
110- OS_PACKAGES : " wget libtool git-all"
103+ OS_PACKAGES : " git-all"
111104
112105 - name : musllinux preparations
113106 if : matrix.cibw_buildlinux == 'musllinux'
114- run : |
115- echo BUILD_COMMAND="apk --no-cache add -q $OS_PACKAGES && set -ex && cd $SCRIPTS $BUILD_STUFF_CMD" >> $GITHUB_ENV
116- echo LDCONFIG_ARG="/usr/lib" >> $GITHUB_ENV
117- echo CIBW_SKIP="cp36-*" >> $GITHUB_ENV
118- env :
119- OS_PACKAGES : " sudo py3-pip python3-dev libtool git \
120- freetype-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev tiff-dev zlib-dev"
121-
122- - uses : actions/cache@v2
123- with :
124- path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
125- key : ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
126- env :
127- NAME : pkg-config
128-
129- - uses : actions/cache@v2
130- with :
131- path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
132- key : ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
107+ run : echo INSTALL_OS_PACKAGES="apk update && apk --no-cache add $OS_PACKAGES" >> $GITHUB_ENV
133108 env :
134- NAME : nasm
109+ OS_PACKAGES : " sudo py3-pip python3-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev "
135110
136111 - uses : actions/cache@v2
137112 with :
138- path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
139- key : ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
140- env :
141- NAME : libde265
142-
143- - uses : actions/cache@v2
144- with :
145- path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
146- key : ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
147- env :
148- NAME : aom
149-
150- - uses : actions/cache@v2
151- with :
152- path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
153- key : ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
154- env :
155- NAME : libheif
113+ path : ${{ env.BUILD_DIR_PREFIX }}/build-tools
114+ key : ${{ env.KEY_HEAD }}-${{ hashFiles('libheif/*.py') }}
156115
157116 - uses : actions/cache@v2
158117 with :
159- path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
160- key : ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
161- env :
162- NAME : libffi
118+ path : ${{ env.BUILD_DIR_PREFIX }}/build-stuff
119+ key : ${{ env.KEY_HEAD }}-${{ hashFiles('libheif/*.*') }}
163120
164121 - name : Run cibuildwheel
165122 run : cibuildwheel
166123 env :
167124 CIBW_BUILD : ${{ format('cp3*-{0}*', matrix.cibw_buildlinux) }}
168125# CIBW_SKIP: "cp36-*"
169126 CIBW_ARCHS : ${{ matrix.cibw_arch }}
170- CIBW_BEFORE_BUILD_LINUX : ${{ env.BUILD_COMMAND }}
171- CIBW_ENVIRONMENT_PASS_LINUX : BUILD_STUFF LDCONFIG_ARG
127+ CIBW_BEFORE_ALL_LINUX : ${{ env.INSTALL_OS_PACKAGES }}
128+ CIBW_ENVIRONMENT_LINUX : BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }}
172129 CIBW_BEFORE_TEST : pip3 install -r requirements_dev.txt
173130 CIBW_TEST_COMMAND : " pytest -s {project}"
174131 CIBW_BUILD_VERBOSITY : 2
@@ -183,6 +140,9 @@ jobs:
183140 path : wheelhouse/*.whl
184141 if-no-files-found : error
185142
143+ - name : Fix cache permissions
144+ run : sudo chmod -R 777 ${{ env.BUILD_DIR_PREFIX }}
145+
186146 sdist :
187147 needs : [wheels_linux, wheels_macos]
188148 name : Source distribution
@@ -214,9 +174,7 @@ jobs:
214174 python3 -m twine check wheelhouse/*
215175
216176 - name : Generate coverage report
217- run : |
218- cd .. && coverage run --rcfile=pillow_heif/pyproject.toml -m pytest pillow_heif
219- cd - && coverage xml --data-file=../.coverage
177+ run : coverage run --rcfile=pyproject.toml -m pytest && coverage xml
220178
221179 - name : Upload report to Codecov
222180 uses : codecov/codecov-action@v2
0 commit comments