Skip to content

ci: add tests matrix #11

ci: add tests matrix

ci: add tests matrix #11

Workflow file for this run

name: Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
workflow_call:
workflow_dispatch:
jobs:
pre_commit:
name: 🧹 Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: πŸ›ŽοΈ Checkout
- name: πŸ“‚ Cache pre-commit paths
uses: actions/cache@v3
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~/.cache/pre-commit
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v4
name: 🐍 Set Python Version
with:
python-version: 3.8
- name: ⛓️ Install-pre-commit
run: python -m pip install --upgrade pre-commit
- name: πŸƒ Run Pre-commit
run: pre-commit run --all-files
test:
name: πŸ§ͺ Tests
needs: [ pre_commit ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
name: πŸ›ŽοΈ Checkout
with:
ref: ${{github.event.pull_request.head.ref}}
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: ⛓️ Install dependencies
run: python -m pip install --upgrade pip tox tox-gh-actions
- name: πŸ§ͺ Run tests with tox
run: tox