From 8523cb61f7dbc2f1492109f32ae803d563f2c945 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Sat, 5 Sep 2026 10:14:42 -0300 Subject: [PATCH] ci: add GitHub validation pipeline --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 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..7fe93e6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: DH V2 CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + +permissions: + contents: read + +concurrency: + group: dhv2-ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + api: + name: API · typecheck, tests, build + runs-on: ubuntu-latest + defaults: + run: + working-directory: api-v3 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: npm + cache-dependency-path: api-v3/package-lock.json + - run: npm ci + - run: npm run typecheck + - run: npm test + - run: npm run build + + web: + name: WEB · typecheck, build + runs-on: ubuntu-latest + defaults: + run: + working-directory: web-v2 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: npm + cache-dependency-path: web-v2/package-lock.json + - run: npm ci + - run: npm run typecheck + - run: npm run build + + contract: + name: Docker / scripts contract + runs-on: ubuntu-latest + needs: [api, web] + steps: + - uses: actions/checkout@v4 + - name: Validate shell scripts + run: | + while IFS= read -r -d '' script; do + bash -n "$script" + done < <(find scripts -type f -name '*.sh' -print0) + - name: Validate Compose + run: docker compose --env-file .env.example config >/dev/null + - name: Build production images + run: docker compose --env-file .env.example build api migrate web