From 943f24b3bdf97183335604c1d5d2b6177eee1763 Mon Sep 17 00:00:00 2001 From: David Dada Date: Sat, 20 Jun 2026 14:17:25 +0100 Subject: [PATCH] ci: fix malformed backend-tests workflow so backend CI runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The on.pull_request.paths block held job-step maps instead of path globs, so Actions found no valid jobs: block and silently skipped the workflow — no tests ran on backend PRs. Restructure with a proper jobs: section: - unit-tests: checkout, setup-node@v4 (Node 20, npm cache), npm ci, npm test. Tests use a temp SQLite db (src/test/setup.ts), so no Postgres/Redis service containers are needed. - validate-compose: docker compose config on deployment/docker-compose.yml. Verified locally: npm ci && npm test passes (89 passed, 16 skipped). Closes #2 --- .github/workflows/backend-tests.yml | 42 +++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 7b263b5..b88cc03 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -1,24 +1,50 @@ name: Backend Tests on: - pull_request: - paths: - - 'backend/**' - - - '.github/workflows/backend-tests.yml' push: branches: - main - develop paths: - 'backend/**' + - '.github/workflows/backend-tests.yml' + pull_request: + paths: + - 'backend/**' + - '.github/workflows/backend-tests.yml' - - name: Upload test results +jobs: + unit-tests: + name: Unit & Integration Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: backend/package-lock.json + - name: Install dependencies + working-directory: backend + run: npm ci + - name: Run tests + working-directory: backend + env: + NODE_ENV: test + run: npm test + # ponytail: tests use a temp SQLite db (src/test/setup.ts), no Postgres/Redis services needed + - name: Upload coverage if: always() uses: actions/upload-artifact@v4 with: - name: test-results-${{ matrix.node-version }} + name: backend-coverage path: backend/coverage/ if-no-files-found: ignore - + validate-compose: + name: Validate Docker Compose + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Validate compose config + run: docker compose -f deployment/docker-compose.yml config