Add basic CI setup #4
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: Lint, Build, Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
lint-build: | |
name: Lint and build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-rye@v3 | |
- name: Install dependencies | |
run: | | |
rye sync | |
- name: Spellcheck | |
run: | | |
rye run typos . | |
- name: Check format | |
run: | | |
rye fmt --check | |
rye run pyproject-fmt --check . | |
- name: Lint | |
run: | | |
rye lint | |
- name: Build | |
run: | | |
rye build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: regdesc-build | |
path: dist/ | |
test: | |
name: Test | |
needs: lint-build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: regdesc-build | |
- name: Install test runner | |
run: | | |
pip install pytest | |
- name: Install source package | |
run: | | |
pip install dist/regdesc-*.tar.gz | |
- name: Test | |
run: | | |
pytest --pyargs regdesc.tests |