| name: Dashboard | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'dashboard/**' | |
| - 'internal/api/types/**' | |
| - 'scripts/build-dashboard.sh' | |
| - '.github/workflows/dashboard.yml' | |
| pull_request: | |
| paths: | |
| - 'dashboard/**' | |
| - 'internal/api/types/**' | |
| - 'scripts/build-dashboard.sh' | |
| - '.github/workflows/dashboard.yml' | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| working-directory: dashboard | |
| jobs: | |
| check: | |
| name: Lint, Type Check & Test | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install tygo | |
| run: go install github.com/gzuidhof/tygo@latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate dashboard types | |
| run: | | |
| $HOME/go/bin/tygo generate | |
| npx prettier --write src/generated/types.ts | |
| git diff --exit-code -- src/generated/types.ts | |
| - name: TypeScript check | |
| run: bun run typecheck | |
| - name: ESLint | |
| run: bun run lint | |
| - name: Prettier check | |
| run: bun run format:check | |
| - name: Run tests | |
| run: bun run test:run | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: check | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install tygo | |
| run: go install github.com/gzuidhof/tygo@latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate dashboard types | |
| run: | | |
| $HOME/go/bin/tygo generate | |
| npx prettier --write src/generated/types.ts | |
| - name: Build | |
| run: bun run build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dashboard-dist | |
| path: dashboard/dist/ | |
| retention-days: 7 | |