Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize old workflows #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,66 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Tox
run: pip install tox
- name: Lint with tox
run: tox run -e lint

tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy3.9"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev", "pypy3.9", "pypy3.10"]
os: ["ubuntu-latest", "windows-latest"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
run: tox run -e py,report_ci,lint
- uses: codecov/codecov-action@v3
run: tox run -e py,report_ci
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install build dependencies
run: pip install --upgrade build
- name: Build distributions
run: python -m build
- name: Upload packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-dist
path: dist/*
retention-days: 1
compression-level: 0

publish:
needs: [tests, package]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
if: github.ref_type == 'tag'
environment:
name: release
url: https://pypi.org/p/pytest-console-scripts
url: https://pypi.org/project/pytest-console-scripts/${{ github.ref_name }}/
permissions:
id-token: write
steps:
- name: Download packages
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-dist
path: dist/
Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# For more information about tox, see https://tox.readthedocs.org/en/latest/
[tox]
envlist = clean,lint,py38,py39,py310,py311,pypy3,report
envlist = clean,lint,py38,py39,py310,py311,py312,pypy3,report

[testenv]
deps =
Expand All @@ -9,8 +9,8 @@ deps =
usedevelop = true
commands = pytest tests --cov=pytest_console_scripts --cov-append --cov-report=term-missing {posargs}
depends =
{py38,py39,py310,py311,pypy3}: clean
report: py38,py39,py310,py311,pypy3
{py38,py39,py310,py311,py312,pypy3}: clean
report: py38,py39,py310,py311,py312,pypy3

[testenv:clean]
deps = coverage
Expand Down Expand Up @@ -41,7 +41,6 @@ deps =
flake8-commas
pep8-naming
mypy
types-setuptools

commands =
check-manifest --ignore *.ini,tests*,.*.yml,demo*,_version.py
Expand Down