Files
crochet/.gitea/workflows/test-build.yaml
T
pablo b28293d5b2
CI / test (push) Failing after 20s
CI / build (push) Has been skipped
feat: added tests
2026-07-16 15:08:04 +02:00

62 lines
2.0 KiB
YAML

name: CI
on:
push:
branches: [master]
defaults:
run:
shell: sh
jobs:
test:
runs-on: ubuntu-latest
container:
image: python:3.13-bookworm
steps:
- name: Checkout
run: |
git clone https://git.spookydev.com/${{ gitea.repository }}.git .
git checkout ${{ gitea.sha }}
- name: Install system dependencies
# libpango/libpangocairo + fuentes: las necesita WeasyPrint en
# tiempo de ejecución para generar el PDF del patrón (ver
# PatternPdfView y crochet/tests/test_pdf.py); sin fuentes
# instaladas, Pango no tiene nada que medir/dibujar y WeasyPrint
# termina haciendo segfault en vez de fallar con un error legible
# (mismo motivo por el que el Dockerfile instala pango + ttf-dejavu
# en Alpine).
run: |
apt-get update -qq
apt-get install -y --no-install-recommends libpango-1.0-0 libpangocairo-1.0-0 fonts-dejavu-core
- name: Install uv
run: pip install uv --quiet
- name: Install dependencies
run: uv pip install --system -r pyproject.toml --group=dev
- name: Run tests
run: uv run pytest
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
run: |
git clone https://git.spookydev.com/${{ gitea.repository }}.git .
git checkout ${{ gitea.sha }}
- name: Build and push
run: |
docker build -t registry.spookydev.com/${{ gitea.repository }}:${{ gitea.sha }} .
docker tag registry.spookydev.com/${{ gitea.repository }}:${{ gitea.sha }} \
registry.spookydev.com/${{ gitea.repository }}:latest
docker login registry.spookydev.com \
-u ${{ secrets.REGISTRY_USER }} \
-p ${{ secrets.REGISTRY_PASSWORD }}
docker push registry.spookydev.com/${{ gitea.repository }}:${{ gitea.sha }}
docker push registry.spookydev.com/${{ gitea.repository }}:latest