Skip to content

Commit c6f9c21

Browse files
committed
Add CI tests for libxmlsec1 versions, lxml versions.
1 parent c66e806 commit c6f9c21

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

Diff for: .github/workflows/ci.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read # to fetch code (actions/checkout)
14+
15+
jobs:
16+
ci:
17+
strategy:
18+
# Allows for matrix sub-jobs to fail without canceling the rest
19+
fail-fast: false
20+
21+
matrix:
22+
os:
23+
- "ubuntu-latest"
24+
- "macos-latest"
25+
# Test with the earliest and latest supported versions of Python, lxml, and libxmlsec1
26+
# so that we get reasonable coverage of the supported versions.
27+
python-version:
28+
- "3.7"
29+
- "3.12"
30+
lxml-version:
31+
- "5.0.0"
32+
- "5.1.0"
33+
libxmlsec1-version:
34+
- "1.3.3"
35+
- "1.2.39"
36+
37+
exclude:
38+
# LXML did not upload a wheel for Python 3.7 so we can't test
39+
# this configuration.
40+
- os: "macos-latest"
41+
python-version: "3.7"
42+
lxml-version: "5.0.0"
43+
44+
env:
45+
PYXMLSEC_STATIC_DEPS: "true"
46+
PYXMLSEC_LIBXML2_VERSION: "2.12.3"
47+
PYXMLSEC_LIBXSLT_VERSION: "1.1.39"
48+
49+
# This defaults to 360 minutes (6h) which is way too long and if a test gets stuck, it can block other pipelines.
50+
# From testing, the runs tend to take 3-8 minutes, so a limit of 30 minutes should be enough.
51+
timeout-minutes: 30
52+
runs-on: ${{ matrix.os }}
53+
54+
steps:
55+
- name: Checkout repo
56+
uses: actions/[email protected]
57+
58+
- name: Setup Python
59+
uses: actions/[email protected]
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
63+
- name: Cache libs
64+
uses: actions/[email protected]
65+
with:
66+
path: libs/*.tar.gz
67+
key: >
68+
libs-
69+
${{ matrix.os }}-
70+
${{ env.PYXMLSEC_LIBXML2_VERSION }}-
71+
${{ env.PYXMLSEC_LIBXSLT_VERSION }}-
72+
${{ matrix.libxmlsec1-version }}
73+
74+
- name: Install build dependencies
75+
run: pip install --upgrade pip setuptools wheel build
76+
77+
- name: Build wheel
78+
run: |
79+
python -m build
80+
rm -rf build/
81+
env:
82+
PYXMLSEC_XMLSEC1_VERSION: ${{ matrix.libxmlsec1-version }}
83+
84+
- name: Install test dependencies
85+
run: |
86+
pip install --only-binary=lxml --upgrade -r requirements-test.txt lxml==${{ matrix.lxml-version }}
87+
pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
88+
89+
- name: Run tests
90+
run: |
91+
pytest -v --color=yes

0 commit comments

Comments
 (0)