Skip to content

Commit

Permalink
CI workflow improvements (#461)
Browse files Browse the repository at this point in the history
* Drop 'checks' job from CI: this job is redundant now that we use pre-commit.ci and readthedocs builds docs for PRs.
* Split workflows into 'deploy' and 'build' for easier management
* Use official Python 3.11 release

Co-authored-by: Florian Bruhin <me@the-compiler.org>
  • Loading branch information
nicoddemus and The-Compiler committed Nov 21, 2022
1 parent 8e99500 commit 9db05d0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 51 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
@@ -0,0 +1,36 @@
name: deploy

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:

deploy:
if: github.repository == 'pytest-dev/pytest-qt'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"

- name: Build package
run: |
python -m pip install --upgrade pip
pip install build
python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.pypi_token }}
55 changes: 4 additions & 51 deletions .github/workflows/main.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false

matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
qt-lib: [pyqt5, pyqt6, pyside2, pyside6]
os: [ubuntu-20.04, windows-latest, macos-latest]
include:
Expand All @@ -22,7 +22,7 @@ jobs:
tox-env: "py39"
- python-version: "3.10"
tox-env: "py310"
- python-version: "3.11-dev"
- python-version: "3.11"
tox-env: "py311"
# https://bugreports.qt.io/browse/PYSIDE-1797
exclude:
Expand All @@ -34,10 +34,10 @@ jobs:
python-version: "3.7"
# Not installable so far
- qt-lib: pyside6
python-version: "3.11-dev"
python-version: "3.11"
- qt-lib: pyside2
os: windows-latest
python-version: "3.11-dev"
python-version: "3.11"

steps:
- uses: actions/checkout@v3
Expand All @@ -58,50 +58,3 @@ jobs:
- name: Test with tox
run: |
tox -e ${{ matrix.tox-env }}-${{ matrix.qt-lib }} -- -ra --color=yes
checks:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.7"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Linting
run: |
tox -e linting
- name: Docs
run: |
tox -e docs
deploy:

if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

runs-on: ubuntu-latest

needs: [build, checks]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.7"
- name: Build package
run: |
python -m pip install --upgrade pip setuptools
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_token }}

0 comments on commit 9db05d0

Please sign in to comment.