Files
zyrarbot/.gitea/workflows/backend.yaml
T
mmacierzanka eaebc12bd2
Panel / Lint, typy i build (pull_request) Successful in 27s
Backend / Lint i formatowanie (pull_request) Successful in 28s
Backend / Testy i kontrakt API (pull_request) Successful in 42s
Backend / Testowy build obrazu (pull_request) Successful in 10s
chore: remove API health check from image built inside a CI runner
required dependencies (Discord token, database) are missing in this environment thus the test will fail
2026-10-01 16:35:25 +02:00

76 lines
1.8 KiB
YAML

name: Backend
on:
push:
branches: [main]
paths:
- "**.py"
- "requirements*.txt"
- "pyproject.toml"
- "Dockerfile"
- ".gitea/workflows/backend.yaml"
pull_request:
paths:
- "**.py"
- "requirements*.txt"
- "pyproject.toml"
- "Dockerfile"
- ".gitea/workflows/backend.yaml"
workflow_dispatch:
env:
PYTHON_VERSION: "3.13"
RUFF_VERSION: "0.16.4"
jobs:
lint:
name: Lint i formatowanie
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Instalacja ruff
run: pip install --no-cache-dir "ruff==${RUFF_VERSION}"
- name: Reguły lintera
run: ruff check --output-format=github .
- name: Zgodność z formatterem
run: ruff format --check --diff .
test:
name: Testy i kontrakt API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
# Zależności instalują się z gotowych kółek - kompilator nie jest
# potrzebny. ffmpeg i libopus są wymagane dopiero przy odtwarzaniu,
# a testy nie dotykają warstwy audio.
- name: Instalacja zależności
run: pip install -r requirements.txt
- name: Testy jednostkowe
run: python -m unittest discover -s tests -t . -v
- name: Kontrola składni całego pakietu
run: python -m compileall -q zyrarbot main.py
image:
name: Testowy build obrazu
runs-on: builder
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- name: Budowa obrazu backendu
run: docker build --tag zyrarbot-api:ci .