Files
FarmaFinder/.gitea/workflows/docker.yaml
T
Ichitux 55a5d93a91
Build & Push Docker Images / test-backend (push) Failing after 18s
Build & Push Docker Images / test-frontend (push) Successful in 22s
Build & Push Docker Images / build-backend (push) Has been skipped
Build & Push Docker Images / build-frontend (push) Has been skipped
fix(frontend): restore PublicView back-compat for tests + CI
The lifted screen-state refactor in PublicView broke App.test.jsx (5
failures): when no `onScreenChange` prop was passed, the click handler
called a no-op, so the screen never advanced from 'home' to 'search'
and the search input was never rendered.

Fix: make screen state uncontrolled-by-default. PublicView owns its
own `useState('home')` and uses the lifted props only when App.jsx
provides them. Same back-compat shape as before, BottomNav still
drives the screen via controlled props in the real app.

Also: vitest defaults to watch mode, which hangs the CI test step
forever. Updated docker.yaml to pass `--run --reporter=basic` so the
job exits with a real pass/fail signal.

Local verification: `npm test -- --run` → 6/6 passing.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 13:06:56 +02:00

68 lines
1.9 KiB
YAML

name: Build & Push Docker Images
run-name: ${{ gitea.actor }} - ${{ gitea.ref }}
on:
push:
branches:
- main
jobs:
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: cd backend && npm ci
- name: Run tests
run: cd backend && npm test -- --run --reporter=basic
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: cd frontend && npm ci
- name: Run tests
run: cd frontend && npm test -- --run --reporter=basic
build-backend:
needs: [ test-backend, test-frontend ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: git.hacecalor.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: .
file: ./backend/Dockerfile
push: true
tags: |
git.hacecalor.net/ichitux/farmafinder-backend:latest
git.hacecalor.net/ichitux/farmafinder-backend:${{ gitea.sha }}
build-frontend:
needs: [ test-backend, test-frontend ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: git.hacecalor.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push frontend image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: true
tags: |
git.hacecalor.net/ichitux/farmafinder-frontend:latest
git.hacecalor.net/ichitux/farmafinder-frontend:${{ gitea.sha }}