Skip to content

Merge pull request #38 from freakboy3742/dependabot/github_actions/do… #57

Merge pull request #38 from freakboy3742/dependabot/github_actions/do…

Merge pull request #38 from freakboy3742/dependabot/github_actions/do… #57

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
name: Pre-commit code style checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v3.1.0
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.X"
- name: Lint with Pre-commit
uses: pre-commit/action@v3.0.0
towncrier:
name: Towncrier changenote check
runs-on: ubuntu-latest
steps:
# Fetch main branch for comparison, then check out current branch.
- name: Check out mainline code
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
ref: main
- name: Check out branch code
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.X"
- name: Install dependencies
run: |
pip install tox
- name: Run towncrier check
run: |
tox -e towncrier-check
package:
name: Package code artefacts
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: "3.X"
- name: Install dependencies
run: |
python -m pip install tox
- name: Build packages
run: |
tox -e package
- name: Upload packages as artefacts
uses: actions/upload-artifact@v4.3.6
with:
name: packages
path: dist
if-no-files-found: error
tests:
needs: [pre-commit, towncrier, package]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"]
pytest-version: ["3", "4", "5", "6", "7", "8"]
exclude:
# PyTest <=5 doesn't work on Python >= 3.10
- python-version: "3.10"
pytest-version: "3"
- python-version: "3.10"
pytest-version: "4"
- python-version: "3.10"
pytest-version: "5"
- python-version: "3.11"
pytest-version: "3"
- python-version: "3.11"
pytest-version: "4"
- python-version: "3.11"
pytest-version: "5"
- python-version: "3.12"
pytest-version: "3"
- python-version: "3.12"
pytest-version: "4"
- python-version: "3.12"
pytest-version: "5"
- python-version: "3.13-dev"
pytest-version: "3"
- python-version: "3.13-dev"
pytest-version: "4"
- python-version: "3.13-dev"
pytest-version: "5"
steps:
- name: Check out code
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Get packages
uses: actions/download-artifact@v4.1.7
with:
name: packages
path: dist
- name: Install dependencies
run: |
python -m pip install tox
- name: Test
run: |
export PY_VERSION=$(cut -d- -f1 <<< ${{ matrix.python-version }})
tox -e py${PY_VERSION/./}-pytest${{ matrix.pytest-version }} --installpkg dist/*.whl