Drop official support for EOL Python versions #270
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
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 }} | |
build-test: | |
# Python version <= 3.7 requires ubuntu-20.04 | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
# Python EOL versions are tested but not supported, once they fail, they will be removed here | |
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- 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 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test | |
run: | | |
pytest --junit-xml=test-results-py${{ matrix.python-version }}-xml.xml | |
- name: Test with lxml | |
run: | | |
pip install lxml | |
pytest --junit-xml=test-results-py${{ matrix.python-version }}-lxml.xml | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results (Python ${{ matrix.python-version }}) | |
path: test-results-py*-*.xml | |
coverage-lint: | |
needs: build-test | |
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: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test and coverage | |
run: | | |
coverage run -m pytest | |
bash <(curl -s https://codecov.io/bash) | |
package-publish: | |
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: | | |
pip install build | |
python -m build | |
ls -lah dist/ | |
echo "=== sources ===" | |
tar -tzvf dist/junitparser-*.tar.gz | |
echo "=== wheel ===" | |
unzip -l dist/junitparser-*.whl | |
echo "=== metadata ===" | |
unzip -p dist/junitparser-*.whl junitparser-*.dist-info/METADATA | |
- 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 }} | |
integration-test: | |
needs: package-publish | |
# Python version <= 3.7 requires ubuntu-20.04 | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
# This might include more Python versions than build-test job above | |
# Python EOL versions are tested but not supported, once they fail, they will be removed here | |
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download Binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: Binaries | |
path: dist/ | |
- name: Run junitparser CLI | |
run: | | |
tar -xzvf dist/junitparser-*.tar.gz -O --wildcards junitparser-*/tests/data/no_fails.xml > no_fails.xml | |
pip install dist/junitparser-*.whl | |
junitparser verify no_fails.xml | |
pip install lxml | |
junitparser verify no_fails.xml |