Skip to content

ci: simplify workflows #52

ci: simplify workflows

ci: simplify workflows #52

Workflow file for this run

name: Python CI
on:
push:
branches: [master]
paths:
- ".github/workflows/python.yml"
- "backend/**"
- "poetry.lock"
- "pyproject.toml"
- "requirements.txt"
- "tests/**"
pull_request:
branches: [master]
paths:
- ".github/workflows/python.yml"
- "backend/**"
- "poetry.lock"
- "pyproject.toml"
- "requirements.txt"
- "tests/**"
env:
PYTHON_VERSION: 3.11
POETRY_VERSION: 1.8.3
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Ruff check
run: poetry run ruff check backend/ tests/
- name: Pyupgrade
run: poetry run pyupgrade --py311-plus **/*.py
test:
runs-on: ubuntu-latest
services:
spamassassin:
image: instantlinux/spamassassin:4.0.0-6
ports:
- 783:783
steps:
- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Make dummy frontend directory
run: mkdir -p frontend/dist/
- name: Wait until SpamAssasin ready
run: poetry run python scripts/ping.py
- name: Run tests
run: poetry run coverage run -m pytest
- name: Coveralls
uses: coverallsapp/github-action@v2