Skip to content

feat(hub): add Postgres and Prisma development setup #287

feat(hub): add Postgres and Prisma development setup

feat(hub): add Postgres and Prisma development setup #287

Workflow file for this run

name: Hub CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
defaults:
run:
working-directory: hub
jobs:
changes:
uses: ./.github/workflows/ci-changes.yml
check:
name: Hub ${{ matrix.command }}${{ matrix.node == 26 && ' (Node 26)' || '' }}
needs: changes
if: ${{ needs.changes.outputs.hub == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [24, 26]
command: [lint, typecheck, test, build, storybook:build, "db:validate"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: hub/package-lock.json
- run: npm ci --engine-strict
- run: npm run ${{ matrix.command }}
integration:
name: Controls and extension tests${{ matrix.node == 26 && ' (Node 26)' || '' }}
needs: changes
if: ${{ needs.changes.outputs.hub == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [24, 26]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: |
hub/package-lock.json
actions/build/package-lock.json
- run: npm ci --engine-strict
- run: npm ci --ignore-scripts --omit=dev --engine-strict
working-directory: actions/build
- run: ../actions/build/node_modules/.bin/playwright install --with-deps chromium
- run: npm run controls:test
- name: Test extension with pinned Chromium
run: |
REPLICA_CHROMIUM_PATH="$(node -p 'require("../actions/build/node_modules/playwright").chromium.executablePath()')"
export REPLICA_CHROMIUM_PATH
npm run extension:test
- run: npm run controls:assets:check
- run: npm run controls:schema:check
- run: npm run extension:assets:check
result:
name: Frontend tests
needs: [changes, check, integration]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Require the selected Hub suite to pass
working-directory: .
env:
SELECTION_RESULT: ${{ needs.changes.result }}
SELECTED: ${{ needs.changes.outputs.hub }}
CHECK_RESULT: ${{ needs.check.result }}
INTEGRATION_RESULT: ${{ needs.integration.result }}
run: |
test "$SELECTION_RESULT" = success
case "$SELECTED" in
true) test "$CHECK_RESULT" = success && test "$INTEGRATION_RESULT" = success ;;
false) test "$CHECK_RESULT" = skipped && test "$INTEGRATION_RESULT" = skipped ;;
*) echo "Invalid Hub suite selection" >&2; exit 1 ;;
esac