dev: upgrade flake.nix to self-contain without .venv #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
STABLE_PYTHON_VERSION: '3.11' | |
PYTHONUNBUFFERED: "1" | |
FORCE_COLOR: "1" | |
jobs: | |
run: | |
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
exclude: # Python < v3.8 does not support Apple Silicon ARM64. | |
- python-version: "3.7" | |
os: macos-latest | |
include: # So run those legacy versions on Intel CPUs. | |
- python-version: "3.7" | |
os: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Ensure latest pip | |
run: python -m pip install --upgrade pip black ruff pytest pytest-cov coverage[toml] | |
- name: Install ourself | |
run: | | |
pip install -e . | |
- name: Lint ruff | |
run: ruff check . | |
- name: Lint black | |
run: black --check --diff . | |
- name: Run tests | |
run: pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=runenv --cov=tests | |