Make python models a bit more sane (#10) #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: 'Code Checks' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: read | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
lint-python: | |
name: PyLint, isort, and flake8 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python 3.12 with Poetry | |
uses: ./.github/actions/setup-python-deps | |
- name: Run Pylint | |
run: poetry run pylint -f colorized --score y ./app | |
- name: Run isort | |
run: poetry run isort -c ./app | |
- name: Run flake8 | |
run: poetry run flake8 --show-source --statistics ./app | |
test-python: | |
name: Python Tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python 3.12 with Poetry | |
uses: ./.github/actions/setup-python-deps | |
- name: Run Pytest | |
run: poetry run pytest --color=yes --doctest-modules --junitxml=junit/test-results.xml ./app/tests | |
- name: Upload pytest results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-results | |
path: junit/test-results.xml | |
if: ${{ always() }} | |
lint-typescript: | |
name: ESLint | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: ESLint | |
run: bun run lint --color |