Skip to content

Testing CI/CD

Testing CI/CD #5

Workflow file for this run

name: tests
on:
push:
branches: [main, test-me-*]
tags:
pull_request:
workflow_dispatch:
jobs:
unit:
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: '3.9'
toxenv: py39
- os: ubuntu-latest
python: '3.10'
toxenv: py310
- os: ubuntu-latest
python: '3.11'
toxenv: py311
- os: ubuntu-latest
python: '3.12'
toxenv: py312
- os: ubuntu-latest
python: '3.13'
toxenv: py313
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Get pip cache dir
id: pip-cache-dir
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
- name: Use pip cache
id: pip-cache
uses: actions/cache@v4
with:
path: ${{ env.PIP_CACHE_DIR }}
key: tests-unit-${{ matrix.os }}-pip-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
tests-unit-${{ matrix.os }}-pip-${{ matrix.python }}-
- name: Install Packages
run: python -m pip install --upgrade pip tox
- name: Run Unit Tests
run: tox -e ${{ matrix.toxenv }} -- -vv
integration:
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: '3.9'
toxenv: py39-all
- os: ubuntu-latest
python: '3.10'
toxenv: py310-all
- os: ubuntu-latest
python: '3.11'
toxenv: py311-all
- os: ubuntu-latest
python: '3.12'
toxenv: py312-all
- os: ubuntu-latest
python: '3.13'
toxenv: py313-all
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Get pip cache dir
id: pip-cache-dir
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
- name: Use pip cache
id: pip-cache
uses: actions/cache@v4
with:
path: ${{ env.PIP_CACHE_DIR }}
key: tests-integration-${{ matrix.os }}-pip-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
tests-integration-${{ matrix.os }}-pip-${{ matrix.python }}-
- name: Install Packages
run: python -m pip install --upgrade pip tox
- name: Run Integration Tests
run: tox -e ${{ matrix.toxenv }} -- -vv
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install tox
run: python -m pip install --upgrade pip tox
- name: Run linting
run: tox -e lint