77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
|
|
concurrency:
|
|
group: ${{github.workflow}}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
tests:
|
|
timeout-minutes: 60
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- python-version: "3.10"
|
|
os: macos-latest
|
|
env:
|
|
TOXENV: py310
|
|
- python-version: "3.11"
|
|
os: macos-latest
|
|
env:
|
|
TOXENV: py311
|
|
- python-version: "3.12"
|
|
os: macos-latest
|
|
env:
|
|
TOXENV: py312
|
|
- python-version: "3.13"
|
|
os: macos-latest
|
|
env:
|
|
TOXENV: py313
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
cache-dependency-path: |
|
|
pyproject.toml
|
|
tox.ini
|
|
|
|
# Install browsers ONCE at the workflow level
|
|
- name: Install browser dependencies
|
|
run: |
|
|
python3 -m pip install --upgrade pip
|
|
python3 -m pip install playwright==1.52.0 rebrowser-playwright==1.52.0 camoufox
|
|
|
|
- name: Install browsers
|
|
run: |
|
|
python3 -m playwright install chromium
|
|
python3 -m playwright install-deps chromium firefox
|
|
python3 -m camoufox fetch --browserforge
|
|
|
|
# Cache tox environments
|
|
- name: Cache tox environments
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .tox
|
|
# Include python version and os in the cache key
|
|
key: tox-v1-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('tox.ini', 'pyproject.toml') }}
|
|
restore-keys: |
|
|
tox-v1-${{ runner.os }}-py${{ matrix.python-version }}-
|
|
tox-v1-${{ runner.os }}-
|
|
|
|
- name: Install tox
|
|
run: pip install -U tox
|
|
|
|
- name: Run tests
|
|
env: ${{ matrix.env }}
|
|
run: tox |