-
-
Notifications
You must be signed in to change notification settings - Fork 62
112 lines (110 loc) · 3.39 KB
/
tests.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
name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
include:
- {name: Python 3.8, python: '3.8', os: ubuntu}
- {name: Python 3.9, python: '3.9', os: ubuntu}
- {name: Python 3.10, python: '3.10', os: ubuntu}
- {name: Python 3.11, python: '3.11', os: ubuntu}
- {name: Python 3.12, python: '3.12', os: ubuntu}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install libxml2
if: startsWith(matrix.python, 'pypy') || startsWith(matrix.python, '3.13')
run: |
sudo apt-get install libxml2-dev libxslt-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[lxml,cli,test,soap]
- name: Test
run: |
pytest --cov=./xsdata --cov-report=xml --cov-branch --doctest-glob="docs/*.md"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
w3c-tests:
name: W3C Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: tefra/xsdata-w3c-tests
ref: main
submodules: true
path: w3c-tests
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools pytest pytest-xdist xmlschema
python -m pip install .[lxml,cli]
- name: Test
run: |
pytest -n auto --mode xsd w3c-tests/tests
benchmark:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install .[lxml,cli,test]
- name: Benchmark
run: |
pytest --benchmark-only --benchmark-columns=min,max,mean,median tests/integration/benchmarks
minimum:
name: Minimum Installation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install pip install .
run: |
pip install -e .[test]
- name: Verify
run: |
python benchmark.py -c XmlEventWriter
python benchmark.py -c XmlEventHandler
python benchmark.py -c JsonParser
python benchmark.py -c JsonSerializer
xsdata | xargs -0 python -c "import sys; assert 'Install cli' in sys.argv[1]"
pre-commit:
name: Pre-commit Hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
check-package:
name: Build & Inspect Package.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v1