Skip to content

Drop official support for EOL Python versions #265

Drop official support for EOL Python versions

Drop official support for EOL Python versions #265

Workflow file for this run

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:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ["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: Publish to pypi
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}