-
Notifications
You must be signed in to change notification settings - Fork 53
138 lines (130 loc) · 3.79 KB
/
ci.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
130
131
132
133
134
135
136
137
138
name: CI
on:
push:
branches: ["master"]
tags:
- "*"
pull_request:
branches: ["master"]
workflow_dispatch:
jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
test-linux:
name: "Test Ubuntu"
uses: "./.github/workflows/test-os.yml"
with:
os: '["ubuntu-24.04"]'
# alive Python versions
python-version: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
# EOL Python versions
include: >
[
{"os": "ubuntu-20.04", "python-version": "3.6"},
{"os": "ubuntu-20.04", "python-version": "3.7"},
{"os": "ubuntu-22.04", "python-version": "3.8"},
]
test-win:
name: "Test Windows"
uses: "./.github/workflows/test-os.yml"
with:
os: '["windows-2025"]'
# alive Python versions
python-version: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
# EOL Python versions
include: >
[
{"os": "windows-2019", "python-version": "3.6"},
{"os": "windows-2019", "python-version": "3.7"},
{"os": "windows-2022", "python-version": "3.8"},
]
test-mac:
name: "Test macOS"
uses: "./.github/workflows/test-os.yml"
with:
os: '["macos-15"]'
# alive Python versions
python-version: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
# EOL Python versions
include: >
[
{"os": "macos-13", "python-version": "3.6"},
{"os": "macos-13", "python-version": "3.7"},
{"os": "macos-14", "python-version": "3.8"},
]
coverage-lint:
name: "Coverage & Lint"
needs: ["test-linux", "test-win", "test-mac"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Setup locales
run: |
sudo locale-gen en_US.UTF-8
sudo locale-gen de_DE.UTF-8
sudo update-locale
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install lxml flake8 pytest coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --max-line-length=127 --show-source --statistics
- name: Test and coverage
run: |
coverage run -m pytest
bash <(curl -s https://codecov.io/bash)
package-publish:
name: "Publish Package"
needs: coverage-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Build packages
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install setuptools wheel
python setup.py sdist bdist_wheel
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Binaries
path: dist/*
- name: Publish to pypi
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
test-whl:
name: "Test whl"
needs: package-publish
uses: "./.github/workflows/test-whl.yml"
with:
os: '["ubuntu-24.04"]'
# alive Python versions
python-version: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
# EOL Python versions
include: >
[
{"os": "ubuntu-20.04", "python-version": "3.6"},
{"os": "ubuntu-20.04", "python-version": "3.7"},
{"os": "ubuntu-22.04", "python-version": "3.8"},
]