Skip to content

tests

tests #350

Workflow file for this run

name: tests
on:
push:
pull_request_target:
schedule: # This is useful for keeping the cache fit and ready
- cron: "42 3 * * 0" # Every Sunday morning when I am fast asleep :)
workflow_dispatch:
jobs:
deploy:
name: python-${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
fail-fast: false
runs-on: ${{ matrix.os }}
env:
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Cache folder for data
uses: actions/cache@v4
id: cache-folder
with:
path: |
cache_opensky
enableCrossOsArchive: true
key: opensky-${{ hashFiles('uv.lock') }}
- name: Install the project
run: uv sync --all-extras --dev --python ${{ matrix.python-version }}
- name: Linting and formatting
run: |
uv run ruff check
uv run ruff format --check
- name: Run tests
if: ${{ (matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest') || steps.cache-folder.outputs.cache-hit == 'true' }}
env:
OPENSKY_USERNAME: ${{ secrets.OPENSKY_USERNAME }}
OPENSKY_PASSWORD: ${{ secrets.OPENSKY_PASSWORD }}
OPENSKY_CACHE: ${{ github.workspace }}/cache_opensky
run: uv run pytest
- name: Minimize uv cache
run: uv cache prune --ci