diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0474f7..68d7464 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: jobs: backend: name: Backend (lint, type-check, unit + integration tests) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 services: postgres: @@ -72,7 +72,7 @@ jobs: frontend: name: Frontend (lint, type-check, unit tests, build) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -105,7 +105,7 @@ jobs: e2e: name: End-to-end tests (Playwright) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [backend, frontend] services: @@ -133,7 +133,11 @@ jobs: - name: Apply migrations to dev database env: PGPASSWORD: postgres - run: psql -h localhost -U postgres -d forkable_learning -f backend/migrations/001_create_practice_platform_tables.sql + run: | + for f in backend/migrations/*.sql; do + echo "applying $f" + psql -v ON_ERROR_STOP=1 -h localhost -U postgres -d forkable_learning -f "$f" + done - name: Install backend dependencies working-directory: backend diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index d14c595..0000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: End-to-End Tests - -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - e2e: - runs-on: ubuntu-latest - services: - postgres: - image: postgres:16 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: testdb - ports: - - 5432:5432 - options: >- - --health-cmd="pg_isready -U postgres" - --health-interval=10s - --health-timeout=5s - --health-retries=5 - - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: 20 - - - name: Install backend dependencies - run: npm ci - working-directory: backend - - - name: Install frontend dependencies - run: npm ci - working-directory: frontend - - - name: Install e2e dependencies - run: npm ci - working-directory: e2e - - - name: Build backend - run: npm run build - working-directory: backend - - - name: Build frontend - run: npm run build - working-directory: frontend - - - name: Run database migrations - run: npm run migrate - working-directory: backend - - - name: Run Playwright tests - run: npx playwright test - working-directory: e2e diff --git a/README.md b/README.md index 8f40348..0268674 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ForkableTypescriptPostgreReactNodejsLearning +[![CI](https://github.com/suryakulshreshtha/ForkableTypescriptPostgreReactNodejsLearning/actions/workflows/ci.yml/badge.svg)](https://github.com/suryakulshreshtha/ForkableTypescriptPostgreReactNodejsLearning/actions/workflows/ci.yml) + A small, fully-tested full-stack reference app — built the way an SDET would build it, with a real test pyramid instead of an afterthought. Fork it, run it, break it, and use it as a template for your own TypeScript + React + Node.js + PostgreSQL projects. **Stack:** React 18 · TypeScript · Node.js / Express · PostgreSQL