ad github actions and other CI files #1
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: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: test-${{ github.head_ref }} | |
cancel-in-progress: true | |
env: | |
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: | |
os: [ubuntu-latest] | |
# os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: true | |
- name: Install dependencies | |
run: pdm install | |
- name: Run lints # These benefit from the autogenerated files | |
run: pdm run mypy | |
- name: Run tests | |
run: pdm run cov | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: ./dist/cov/coverage.xml | |
name: ${{ runner.os }}-${{ matrix.python-version }} |