diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdcb5ee..bb62910 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,48 @@ jobs: - run: npm run coverage - run: npm run build + e2e: + name: End-to-end + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_DB: horaires_e2e + POSTGRES_USER: horaires + POSTGRES_PASSWORD: horaires + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U horaires -d horaires_e2e" + --health-interval 5s + --health-timeout 5s + --health-retries 20 + + env: + DATABASE_URL: postgresql://horaires:horaires@localhost:5432/horaires_e2e?schema=public + TEST_DATABASE_URL: postgresql://horaires:horaires@localhost:5432/horaires_e2e?schema=public + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: npm + - run: npm ci + - run: npx prisma generate + - run: npx prisma migrate deploy + # The runner can install the system packages a local machine cannot. + - run: npx playwright install --with-deps chromium + - run: npm run e2e + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: playwright-report + path: playwright-report/ + retention-days: 7 + docker: name: Docker image runs-on: ubuntu-latest diff --git a/app/admin/horaires/WeekEditor.tsx b/app/admin/horaires/WeekEditor.tsx index 7c0d3f0..2555876 100644 --- a/app/admin/horaires/WeekEditor.tsx +++ b/app/admin/horaires/WeekEditor.tsx @@ -121,6 +121,10 @@ export default function WeekEditor({ initial, canEdit }: Props) {