From 8477bb00c38f3ea6249dcf4d3d09ab1aab4cdb74 Mon Sep 17 00:00:00 2001 From: Yarin Levi <41652571+YarinQuapi@users.noreply.github.com> Date: Mon, 9 Nov 2026 08:22:06 +0200 Subject: [PATCH] Add CI workflow for API, web and mobile Runs on every pull request, on pushes to master, and on demand: - API: generate the Prisma client, typecheck, run tests - Web: typecheck and build - Mobile: flutter analyze (style infos reported, not fatal) and flutter test Uses the same Node and action versions as publish-api.yml, pins Flutter 3.47.6, and cancels runs made obsolete by a newer push. Deployment stays in publish-api.yml. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c6e44ce --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,82 @@ +# Checks every pull request (and master) before anything is deployed: +# API typecheck + tests, web typecheck + build, Flutter analyze + tests. +# Deployment stays in publish-api.yml. + +name: CI + +on: + pull_request: + push: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + +# A new push to the same PR cancels the run that is now out of date. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + api: + name: API (typecheck + tests) + runs-on: ubuntu-latest + timeout-minutes: 15 + # Prisma reads these at generate time; tests do not touch a database. + env: + DATABASE_URL: mysql://ci:ci@127.0.0.1:3306/ci + DATABASE_HOST: 127.0.0.1 + DATABASE_USER: ci + DATABASE_PASSWORD: ci + DATABASE_NAME: ci + DATABASE_PORT: 3306 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 22 + cache: npm + - run: npm ci + - name: Generate Prisma client + working-directory: apps/api + run: npx prisma generate --config prisma7.config.ts + - name: Typecheck + run: npx tsc --noEmit -p apps/api + - name: Test + run: npm test + + web: + name: Web (typecheck + build) + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: 22 + cache: npm + - run: npm ci + - name: Typecheck and build + run: npm run build -w @drop-it/web + + mobile: + name: Mobile (analyze + tests) + runs-on: ubuntu-latest + timeout-minutes: 20 + defaults: + run: + working-directory: apps/mobile + steps: + - uses: actions/checkout@v7 + - uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: 3.47.6 + cache: true + - run: flutter pub get + # Errors and warnings fail the build; style infos are reported only. + - name: Analyze + run: flutter analyze --no-fatal-infos + - name: Test + run: flutter test