Skip to content

Commit 45241ca

Browse files
committed
Use cache for manylinux
1 parent c317685 commit 45241ca

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

.github/workflows/manylinux.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,80 @@ on: [push, pull_request]
33
concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: ${{ github.ref_name != 'master' }}
6+
67
jobs:
8+
cache_libs:
9+
uses: ./.github/workflows/cache_libs.yml
10+
secrets: inherit
11+
712
manylinux:
13+
needs: cache_libs
814
runs-on: ubuntu-latest
15+
16+
env:
17+
LIBXML2_VERSION: ${{ needs.cache_libs.outputs.LIBXML2_VERSION }}
18+
LIBXSLT_VERSION: ${{ needs.cache_libs.outputs.LIBXSLT_VERSION }}
19+
920
strategy:
1021
matrix:
1122
python-abi: [cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312, cp313-cp313, cp314-cp314]
1223
image:
1324
- manylinux2014_x86_64
1425
- manylinux_2_28_x86_64
1526
- musllinux_1_2_x86_64
27+
1628
container: quay.io/pypa/${{ matrix.image }}
29+
1730
steps:
1831
- uses: actions/checkout@v1
32+
1933
- name: Install python build dependencies
2034
run: |
2135
# https://github.com/actions/runner/issues/2033
2236
chown -R $(id -u):$(id -g) $PWD
2337
/opt/python/${{ matrix.python-abi }}/bin/pip install --upgrade pip setuptools wheel build 'setuptools_scm>=8'
38+
2439
- name: Install system build dependencies (manylinux)
40+
if: contains(matrix.image, 'manylinux')
2541
run: |
2642
yum install -y perl-core
27-
if: contains(matrix.image, 'manylinux')
43+
2844
- name: Set environment variables
2945
shell: bash
3046
run: |
3147
PKGVER=$(/opt/python/${{ matrix.python-abi }}/bin/python setup.py --version)
3248
echo "PKGVER=$PKGVER"
3349
echo "PKGVER=$PKGVER" >> $GITHUB_ENV
50+
51+
- name: Cache [libs]
52+
uses: actions/cache/restore@v4.3.0
53+
with:
54+
path: |
55+
libs/*.xz
56+
libs/*.gz
57+
libs/*.zip
58+
key: libs-${{ runner.os }}-${{ runner.arch }}-${{ env.LIBXML2_VERSION }}-${{ env.LIBXSLT_VERSION }}
59+
3460
- name: Build linux_x86_64 wheel
3561
env:
3662
PYXMLSEC_STATIC_DEPS: true
37-
PYXMLSEC_LIBXML2_VERSION: 2.14.6 # Lock it to libxml2 2.14.6 to match it with lxml
3863
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3964
run: |
4065
/opt/python/${{ matrix.python-abi }}/bin/python -m build
66+
4167
- name: Label manylinux wheel
4268
run: |
4369
ls -la dist/
4470
auditwheel show dist/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-linux_x86_64.whl
4571
auditwheel repair dist/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-linux_x86_64.whl
4672
ls -la wheelhouse/
4773
auditwheel show wheelhouse/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-*${{ matrix.image }}*.whl
74+
4875
- name: Install test dependencies
4976
run: |
5077
/opt/python/${{ matrix.python-abi }}/bin/pip install --upgrade -r requirements-test.txt
5178
/opt/python/${{ matrix.python-abi }}/bin/pip install xmlsec --only-binary=xmlsec --no-index --find-links=wheelhouse/
79+
5280
- name: Run tests
5381
run: |
5482
/opt/python/${{ matrix.python-abi }}/bin/pytest -v --color=yes

build_support/lib_xmlsec_dependency_builder.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,28 @@ def triplet(self) -> str:
3636
class LibXmlsecDependencyBuilder:
3737
WINDOWS_LIBS_DOWNLOAD_RELEASE_URL = 'https://github.com/mxamin/python-xmlsec-win-binaries/releases/download/2025.07.10/'
3838
LIB_VERSION_ENV_VARS = {
39-
'openssl_version': 'PYXMLSEC_OPENSSL_VERSION',
4039
'libiconv_version': 'PYXMLSEC_LIBICONV_VERSION',
4140
'libxml2_version': 'PYXMLSEC_LIBXML2_VERSION',
4241
'libxslt_version': 'PYXMLSEC_LIBXSLT_VERSION',
43-
'zlib_version': 'PYXMLSEC_ZLIB_VERSION',
42+
'openssl_version': 'PYXMLSEC_OPENSSL_VERSION',
4443
'xmlsec1_version': 'PYXMLSEC_XMLSEC1_VERSION',
44+
'zlib_version': 'PYXMLSEC_ZLIB_VERSION',
4545
}
4646
UNIX_DEFAULT_LIB_VERSIONS = {
47-
'openssl_version': '3.6.0',
4847
'libiconv_version': '1.18',
49-
'libxml2_version': '2.14.6',
48+
'libxml2_version': '2.14.6', # Make sure it matches with lxml
5049
'libxslt_version': '1.1.43',
51-
'zlib_version': '1.3.1',
50+
'openssl_version': '3.6.0',
5251
'xmlsec1_version': '1.3.9',
52+
'zlib_version': '1.3.1',
5353
}
5454
WINDOWS_DEFAULT_LIB_VERSIONS = {
55-
'openssl_version': '3.0.16.pl1',
5655
'libiconv_version': '1.18-1',
57-
'libxml2_version': '2.11.9-3',
56+
'libxml2_version': '2.11.9-3', # Make sure it matches with lxml
5857
'libxslt_version': '1.1.39',
59-
'zlib_version': '1.3.1',
58+
'openssl_version': '3.0.16.pl1',
6059
'xmlsec1_version': '1.3.7',
60+
'zlib_version': '1.3.1',
6161
}
6262

6363
def __init__(self, platform_name, info=None, libs_dir=None, buildroot=None, plat_name=None):

0 commit comments

Comments
 (0)