Skip to content

Commit

Permalink
Merge branch 'master' into from-methods-return-type
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi authored Feb 20, 2025
2 parents 5cbf10d + bca6112 commit b2d41f3
Show file tree
Hide file tree
Showing 14 changed files with 642 additions and 205 deletions.
107 changes: 0 additions & 107 deletions .github/workflows/build.yml

This file was deleted.

138 changes: 138 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"},
]
57 changes: 57 additions & 0 deletions .github/workflows/test-os.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Test OS

on:
workflow_call:
inputs:
os:
required: true
type: string
python-version:
required: true
type: string
include:
required: true
type: string

jobs:
test:
name: Test (python-${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(inputs.os) }}
python-version: ${{ fromJson(inputs.python-version) }}
include: ${{ fromJson(inputs.include) }}

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
if: startsWith(matrix.os, 'ubuntu')
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
shell: bash
- 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 }}, ${{ matrix.os }})
path: test-results-py*-*.xml
2 changes: 1 addition & 1 deletion .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test Results

on:
workflow_run:
workflows: ["build"]
workflows: ["build", "CI"]
types:
- completed
permissions: {}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/test-whl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test whl

on:
workflow_call:
inputs:
os:
required: true
type: string
python-version:
required: true
type: string
include:
required: true
type: string

jobs:
test:
name: Test whl (python-${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(inputs.os) }}
python-version: ${{ fromJson(inputs.python-version) }}
include: ${{ fromJson(inputs.include) }}

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: |
pip install dist/junitparser-*.whl
wget https://raw.githubusercontent.com/weiwei/junitparser/003587443fd6f332e9a6bd4b027e657a76cca033/tests/data/no_fails.xml
junitparser verify no_fails.xml
pip install lxml
junitparser verify no_fails.xml
Loading

0 comments on commit b2d41f3

Please sign in to comment.