diff --git a/.github/workflows/job_detect_changes.yaml b/.github/workflows/job_detect_changes.yaml index 094fde5e56..2edc971dd9 100644 --- a/.github/workflows/job_detect_changes.yaml +++ b/.github/workflows/job_detect_changes.yaml @@ -74,12 +74,25 @@ jobs: # Dashboard application and its dependencies dashboard: - - 'apps/dashboard/**' - - 'internal/ui/**' + - 'apps/dashboard/**/!(*.md|*.txt)' + - 'apps/dashboard/!(*.md|*.txt)' + - 'internal/billing/**' + - 'internal/clickhouse/**' + - 'internal/db/**' + - 'internal/encryption/**' + - 'internal/events/**' + - 'internal/hash/**' - 'internal/icons/**' + - 'internal/id/**' + - 'internal/keys/**' + - 'internal/proto/**' - 'internal/resend/**' + - 'internal/schema/**' + - 'internal/ui/**' - 'internal/validation/**' - 'internal/vercel/**' + - 'packages/error/**' + - 'packages/rbac/**' # Agent application (Go-based) agent: @@ -91,9 +104,8 @@ jobs: # Go services (API v2, Ctrl, Deploy services) go: - - 'go/**' - - '!go/benchmarks/**' - - '!go/demo_api/**' + - 'go/!(benchmarks|demo_api)/**' + - 'go/!(benchmarks|demo_api)' # ClickHouse schema and related clickhouse: diff --git a/.github/workflows/job_test_dashboard.yaml b/.github/workflows/job_test_dashboard.yaml new file mode 100644 index 0000000000..768d73ae85 --- /dev/null +++ b/.github/workflows/job_test_dashboard.yaml @@ -0,0 +1,37 @@ +name: Test Dashboard +on: + workflow_call: +permissions: + contents: read +jobs: + test: + name: Test Dashboard + runs-on: depot-ubuntu-24.04-4 + steps: + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + - name: Setup Node + uses: ./.github/actions/setup-node + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Test + run: pnpm turbo run test --filter=@unkey/dashboard + env: + CI: 1 + - name: Build + run: pnpm turbo run build --filter=@unkey/dashboard + env: + CI: 1 + DATABASE_HOST: localhost:8080 + DATABASE_USERNAME: unkey + DATABASE_PASSWORD: password + DATABASE_NAME: unkey + UNKEY_WORKSPACE_ID: "not-empty" + UNKEY_API_ID: "not-empty" + UNKEY_WEBHOOK_KEYS_API_ID: "not-empty" + AGENT_URL: "http://localhost:8080" + AGENT_TOKEN: "not-empty" + AUTH_PROVIDER: "workos" + WORKOS_CLIENT_ID: "client_" + WORKOS_API_KEY: "sk_test_" + WORKOS_COOKIE_PASSWORD: "IAMACOOKIEPASSWORD" + NEXT_PUBLIC_WORKOS_REDIRECT_URI: "http://localhost:3000/auth/sso-callback" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2154d855d7..cbbeab27fd 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -22,12 +22,12 @@ jobs: uses: ./.github/workflows/job_test_unit.yaml build: name: Build - if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name != 'pull_request' && needs.detect_changes.result == 'success' && (needs.detect_changes.outputs.api == 'true' || needs.detect_changes.outputs.packages == 'true') + if: ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name != 'pull_request') && needs.detect_changes.result == 'success' && (needs.detect_changes.outputs.api == 'true' || needs.detect_changes.outputs.packages == 'true') needs: [detect_changes] uses: ./.github/workflows/build.yaml test_api: name: Test API - if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name != 'pull_request' && needs.detect_changes.result == 'success' && (needs.detect_changes.outputs.api == 'true' || needs.detect_changes.outputs.packages == 'true') + if: ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name != 'pull_request') && needs.detect_changes.result == 'success' && (needs.detect_changes.outputs.api == 'true' || needs.detect_changes.outputs.packages == 'true') needs: [detect_changes] uses: ./.github/workflows/job_test_api_local.yaml test_go_api_local: @@ -35,3 +35,8 @@ jobs: if: ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name != 'pull_request') && needs.detect_changes.result == 'success' && needs.detect_changes.outputs.go == 'true' needs: [detect_changes] uses: ./.github/workflows/job_test_go_api_local.yaml + test_dashboard: + name: Test Dashboard + if: ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name != 'pull_request') && needs.detect_changes.result == 'success' && needs.detect_changes.outputs.dashboard == 'true' + needs: [detect_changes] + uses: ./.github/workflows/job_test_dashboard.yaml diff --git a/apps/dashboard/test-file.tsx b/apps/dashboard/test-file.tsx new file mode 100644 index 0000000000..e69de29bb2