Skip to content

ci/lint: convert lints to pre-commit & Ruff #121

ci/lint: convert lints to pre-commit & Ruff

ci/lint: convert lints to pre-commit & Ruff #121

Workflow file for this run

name: Test
on: [push, pull_request, workflow_dispatch]
env:
FORCE_COLOR: 1
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["pypy-2.7", "pypy-3.8", "2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# Add new helper variables to existing jobs
- {python-version: "pypy-2.7", toxenv: "pypy"}
- {python-version: "pypy-3.8", toxenv: "pypy3"}
- {python-version: "2.7", toxenv: "py27"}
- {python-version: "3.7", toxenv: "py37"}
- {python-version: "3.8", toxenv: "py38"}
- {python-version: "3.9", toxenv: "py39"}
- {python-version: "3.10", toxenv: "py310"}
- {python-version: "3.11", toxenv: "py311"}
- {python-version: "3.12", toxenv: "py312"}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install tox
- name: Tox tests
run: |
tox -e ${{ matrix.toxenv }}