Explicit support for python 3.13 #418
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: Test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
# Every friday at 22:00 UTC (Every saturday at 07:00 KST/JST) | |
- cron: "0 22 * * FRI" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
test: | |
name: Test Python ${{ matrix.python-version }} [${{ matrix.qt-api }}] | |
runs-on: ubuntu-latest | |
env: | |
DISPLAY: ":99.0" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11", "3.12", "3.13"] | |
qt-api: ["pyqt6", "pyside6"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: tlambert03/setup-qt-libs@v1 | |
- name: Setup for Qt testing | |
run: | | |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
python-version: ${{ matrix.python-version }} | |
- name: Install project with all extras | |
run: | | |
uv sync --all-extras --dev --group ${{ matrix.qt-api }} | |
export QT_API=${{ matrix.qt-api }} | |
- name: Test with pytest | |
if: matrix.python-version != '3.12' || matrix.qt-api != 'pyside6' | |
run: uv run pytest | |
- name: Test with pytest with coverage | |
if: matrix.python-version == '3.12' && matrix.qt-api == 'pyside6' | |
run: uv run pytest -v --cov erlab --junitxml=junit.xml | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.12' && matrix.qt-api == 'pyside6' | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload test results to Codecov | |
if: ${{ matrix.python-version == '3.12' && matrix.qt-api == 'pyside6' && !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
mypy: | |
name: Static type checking | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
python-version: "3.12" | |
- name: Install mypy and dependencies | |
run: uv sync --all-extras --dev --group pyqt6 | |
- name: Run mypy | |
run: uv run mypy --install-types --non-interactive --html-report mypy-report . | |
- name: Upload mypy results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: mypy-report | |
path: mypy-report/ | |
if-no-files-found: error | |
changelog: | |
name: Update changelog | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.repository == 'kmnhan/erlabpy' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --pre numba | |
python -m pip install commitizen cz-changeup | |
- name: Generate changelog | |
run: | | |
cz changelog | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "chore: update changelog" | |
git push | |
else | |
echo "nothing to commit, working tree clean" | |
fi |