add github actions and other CI files #6
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" | |
QT_SELECT: "qt6" | |
QT_QPA_PLATFORM: "offscreen" | |
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: Set up ${{ matrix.os }} | |
run: | | |
sudo apt-get update; sudo apt-get install qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-wayland qt6-l10n-tools | |
qtchooser -install qt6 $(which qmake6) | |
- 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 }} |