Merge pull request #53 from kaitj/bug/release-pypi #272
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 and test workflow | |
on: | |
push: | |
branches: ['*', '!push-action/*'] | |
pull_request: | |
branches: ['*', '!push-action/*'] | |
jobs: | |
quality: | |
name: Lint code | |
if: github.event.pull_request.merged == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python environment | |
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.2 | |
with: | |
python-version: '3.10' | |
- name: yamlfix | |
run: poetry run poe yamlfix-check | |
- name: isort | |
run: poetry run poe isort-check | |
- name: black | |
run: poetry run poe black-check | |
- name: ruff | |
run: poetry run poe ruff-check | |
- name: pyright | |
run: poetry run poe pyright | |
test: | |
runs-on: ubuntu-latest | |
needs: [quality] | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
test-split: ['1', '2', '3', '4', '5'] | |
steps: | |
- name: Setup Python environment | |
uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
install-library: "true" | |
- name: Perform unit testing | |
run: >- | |
poetry run pytest -n auto --splits 5 --group ${{ matrix.test-split }} --doctest-modules --cov=afids_utils | |
afids_utils/tests/ --cov-report xml:../cov.xml | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ../cov.xml |