Skip to content

ci: Modularize CI pipeline and test Python >= 3.11 #32

ci: Modularize CI pipeline and test Python >= 3.11

ci: Modularize CI pipeline and test Python >= 3.11 #32

Workflow file for this run

name: Backend
on:
pull_request:
paths:
- 'src/**'
- 'tests/**'
- pyproject.toml
- Makefile
- requirements*.txt
- .github/workflows/backend.yml
permissions:
contents: read
pull-requests: write
jobs:
lint-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Lint backend
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
pre-commit run --all-files ruff
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build frontend and share library
shell: bash
run: make build-frontend
- name: Build package distributions
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m build
- name: Install
run: |
python -m pip install dist/*.whl --no-dependencies
python -m pip install -r requirements.txt -r requirements-test.txt
- name: Pytest
timeout-minutes: 5
run: python -m pytest --cov-report html:coverage.xml
- name: Coverage
shell: bash
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${REPOSITORY_OWNER}/${REPOSITORY_NAME}/issues/${PULL_REQUEST_NUMBER}/comments \
-f "body=`cat coverage.xml`"
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
REPOSITORY_NAME: ${{ github.event.repository.name }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}