57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
# CI for Gitea Actions (git.utopiadeals.com). GitHub-compatible syntax — if the repo ever
|
|
# moves to GitHub, copy this file to .github/workflows/ci.yml unchanged.
|
|
#
|
|
# Requires a Gitea Actions runner to be registered on the server
|
|
# (Site Administration -> Actions -> Runners; docker label recommended).
|
|
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
backend-tests:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ar-aging-app/backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
cache-dependency-path: ar-aging-app/backend/requirements.txt
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
- name: Run tests (isolated temp DB — never touches real data)
|
|
run: python -m pytest -q
|
|
|
|
frontend-build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ar-aging-app/frontend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
- name: Install dependencies
|
|
run: npm ci || npm install
|
|
- name: Type-check + production build
|
|
run: npm run build
|
|
|
|
docker-images:
|
|
# Prove both production images actually build — the exact images the server will run.
|
|
runs-on: ubuntu-latest
|
|
needs: [backend-tests, frontend-build]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build backend image
|
|
run: docker build ar-aging-app/backend -t ar-backend:ci
|
|
- name: Build frontend (nginx) image
|
|
run: docker build ar-aging-app/frontend --target prod -t ar-web:ci
|