diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d3cc07e..0da212e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,17 +1,48 @@ name: CI +# Parallel org callers. ci-complete is the check name the CI complete ruleset +# requires. merge_group stays so the merge queue runs these portions. +# There is no terraform/ tree on main, so this caller has no terraform job. + on: pull_request: - branches: [main] + branches: [main, hotfix/**, release/**] merge_group: + push: + branches: [hotfix/**, release/**] permissions: contents: read jobs: - ci: - # Job id MUST stay `ci`: the reusable's job is also `ci`, so the check - # context resolves to the required `ci / ci`. - uses: Sea-Haven-Industries/.github/.github/workflows/ci-typescript-frontend.yaml@9781774f04b824b1182ff41638687f1c01c04361 # v1.0.11 + autofix: + if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork + uses: Sea-Haven-Industries/.github/.github/workflows/ci-autofix.yaml@0a1010e63248c9ca9f042c870eb2c579ba6b9455 # v1.0.19 + permissions: + contents: write + secrets: inherit + with: + presets: prettier + + frontend: + needs: autofix + if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true') + uses: Sea-Haven-Industries/.github/.github/workflows/ci-frontend.yaml@0a1010e63248c9ca9f042c870eb2c579ba6b9455 # v1.0.19 with: node-version: "24" + unit-shards: 1 + run-e2e: true + + ci-complete: + name: ci-complete + needs: [autofix, frontend] + if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true') + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Require portions + env: + FRONTEND: ${{ needs.frontend.result }} + run: | + set -euo pipefail + test "${FRONTEND}" = success diff --git a/package.json b/package.json index b8ed615..a41889b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "db:migrate": "npm run db:migrate -w @seahaven-ap/api", "db:seed": "npm run db:seed -w @seahaven-ap/api", "db:generate": "npm run db:generate -w @seahaven-ap/api", - "test": "npm run test -w @seahaven-ap/shared && npm run test -w @seahaven-ap/api && vitest run", + "test": "npm run build:shared && npm run test -w @seahaven-ap/shared && npm run test -w @seahaven-ap/api && vitest run", "test:watch": "vitest", "test:e2e": "playwright test", "lint": "eslint . --max-warnings=0 && npm run lint:api",