Repository navigation
chore: harden ui eslint rules and enable tsc typechecking #4998
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2026 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: 'XMC Headless E2E Tests' | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| merge_group: | |
| workflow_call: | |
| secrets: | |
| GCP_E2E_PROJECT_ID: | |
| required: false | |
| GCP_E2E_WORKLOAD_IDENTITY_PROVIDER: | |
| required: false | |
| GCP_E2E_SERVICE_ACCOUNT: | |
| required: false | |
| GCP_E2E_SPANNER_INSTANCE: | |
| required: false | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| execute-e2e: | |
| name: 'Execute KinD & Playwright Headless E2E' | |
| if: github.event_name != 'pull_request' | |
| runs-on: 'ubuntu-latest' | |
| environment: e2e-test | |
| timeout-minutes: 45 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: 'Reclaim Unused Runner Disk Space' | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/share/boost | |
| df -h / | |
| - name: 'Validate CI Secrets Configuration' | |
| env: | |
| GCP_E2E_PROJECT_ID: ${{ secrets.GCP_E2E_PROJECT_ID }} | |
| GCP_E2E_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_E2E_WORKLOAD_IDENTITY_PROVIDER }} | |
| GCP_E2E_SERVICE_ACCOUNT: ${{ secrets.GCP_E2E_SERVICE_ACCOUNT }} | |
| GCP_E2E_SPANNER_INSTANCE: ${{ secrets.GCP_E2E_SPANNER_INSTANCE }} | |
| run: | | |
| if [ -z "${GCP_E2E_PROJECT_ID}" ] || [ -z "${GCP_E2E_WORKLOAD_IDENTITY_PROVIDER}" ] || [ -z "${GCP_E2E_SERVICE_ACCOUNT}" ] || [ -z "${GCP_E2E_SPANNER_INSTANCE}" ]; then | |
| echo "::error::Required GitHub Secrets (GCP_E2E_PROJECT_ID, GCP_E2E_WORKLOAD_IDENTITY_PROVIDER, GCP_E2E_SERVICE_ACCOUNT, GCP_E2E_SPANNER_INSTANCE) are not configured." | |
| exit 1 | |
| fi | |
| - name: 'Authenticate to Google Cloud via Workload Identity Federation' | |
| uses: 'google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed' # v2.1.13 | |
| with: | |
| project_id: '${{ secrets.GCP_E2E_PROJECT_ID }}' | |
| workload_identity_provider: '${{ secrets.GCP_E2E_WORKLOAD_IDENTITY_PROVIDER }}' | |
| service_account: '${{ secrets.GCP_E2E_SERVICE_ACCOUNT }}' | |
| - name: 'Configure Docker Auth for GCP Artifact Registry' | |
| run: | | |
| gcloud auth configure-docker us-docker.pkg.dev --quiet | |
| - name: 'Set up Cloud SDK' | |
| run: | | |
| if ! command -v gcloud &>/dev/null; then | |
| curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg | |
| echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list | |
| sudo apt-get update && sudo apt-get install -y --no-install-recommends google-cloud-cli | |
| fi | |
| gcloud version | head -n 1 | |
| - name: 'Set up Bazel' | |
| uses: 'bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2' # v3.0.0 | |
| - name: 'Restore Bazel Repository Cache' | |
| id: 'cache-bazel-repo-restore' | |
| uses: 'actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf' # v4.2.2 | |
| with: | |
| path: ~/.cache/bazel-repo | |
| key: bazel-repo-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock', 'go.mod', 'go.sum') }} | |
| restore-keys: | | |
| bazel-repo-${{ runner.os }}- | |
| - name: 'Restore Bazel Disk Cache' | |
| id: 'cache-bazel-disk-restore' | |
| uses: 'actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf' # v4.2.2 | |
| with: | |
| path: ~/.cache/bazel-disk | |
| key: bazel-disk-${{ runner.os }}-${{ github.sha }} | |
| restore-keys: | | |
| bazel-disk-${{ runner.os }}- | |
| - name: 'Configure Bazel Cache Settings' | |
| run: | | |
| mkdir -p ~/.cache/bazel-repo ~/.cache/bazel-disk | |
| cat << EOF_BAZEL >> ~/.bazelrc | |
| common --config=ci | |
| common --disk_cache=${HOME}/.cache/bazel-disk | |
| common --repository_cache=${HOME}/.cache/bazel-repo | |
| common --experimental_repository_cache_hardlinks | |
| EOF_BAZEL | |
| - name: 'Cache UI Node Modules' | |
| id: 'cache-ui-node-modules' | |
| uses: 'actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf' # v4.2.2 | |
| with: | |
| path: cmd/ui/node_modules | |
| key: ui-node-modules-${{ runner.os }}-${{ hashFiles('cmd/ui/package-lock.json') }} | |
| - name: 'Mark UI Node Modules Sentinel on Cache Hit' | |
| if: steps.cache-ui-node-modules.outputs.cache-hit == 'true' | |
| run: | | |
| mkdir -p cmd/ui/node_modules | |
| printf 'ok' > cmd/ui/node_modules/.install-success | |
| - name: 'Set up Python' | |
| uses: 'actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38' # v5.4.0 | |
| with: | |
| python-version: '3.13' | |
| - name: 'Install Kubectl, KinD, and Helm' | |
| run: | | |
| mkdir -p "${HOME}/.local/bin" | |
| echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" | |
| export PATH="${HOME}/.local/bin:${PATH}" | |
| if ! command -v kubectl &>/dev/null; then | |
| curl -fsSL "https://dl.k8s.io/release/v1.32.2/bin/linux/amd64/kubectl" -o "${HOME}/.local/bin/kubectl" | |
| chmod +x "${HOME}/.local/bin/kubectl" | |
| fi | |
| if ! command -v kind &>/dev/null; then | |
| curl -fsSL "https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64" -o "${HOME}/.local/bin/kind" | |
| chmod +x "${HOME}/.local/bin/kind" | |
| fi | |
| if ! command -v helm &>/dev/null; then | |
| HELM_VERSION="v3.20.1" | |
| curl -fsSL "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" -o /tmp/helm.tar.gz | |
| tar -zxvf /tmp/helm.tar.gz -C /tmp linux-amd64/helm | |
| mv /tmp/linux-amd64/helm "${HOME}/.local/bin/helm" | |
| rm -rf /tmp/helm.tar.gz /tmp/linux-amd64 | |
| fi | |
| kubectl version --client | |
| kind --version | |
| helm version --short | |
| - name: 'Run E2E Test Suite' | |
| env: | |
| GCP_PROJECT_ID: '${{ secrets.GCP_E2E_PROJECT_ID }}' | |
| SPANNER_INSTANCE: '${{ secrets.GCP_E2E_SPANNER_INSTANCE }}' | |
| XMC_SCREENSHOTS_DIR: '${{ github.workspace }}/e2e-screenshots' | |
| XMC_KIND_NODE_IMAGE: 'us-docker.pkg.dev/${{ secrets.GCP_E2E_PROJECT_ID }}/xmc/kindest-node:v1.33.1' | |
| PLAYWRIGHT_HOST_PLATFORM_OVERRIDE: 'ubuntu24.04-x64' | |
| run: | | |
| mkdir -p "${XMC_SCREENSHOTS_DIR}" | |
| exec python3 test/e2e/runner.py --screenshots-dir "${XMC_SCREENSHOTS_DIR}" | |
| - name: 'Save Bazel Repository Cache' | |
| uses: 'actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf' # v4.2.2 | |
| if: (github.ref == 'refs/heads/main' || github.event_name == 'merge_group' || steps.cache-bazel-repo-restore.outputs.cache-matched-key == '') && steps.cache-bazel-repo-restore.outputs.cache-hit != 'true' | |
| with: | |
| path: ~/.cache/bazel-repo | |
| key: bazel-repo-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock', 'go.mod', 'go.sum') }} | |
| - name: 'Save Bazel Disk Cache' | |
| uses: 'actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf' # v4.2.2 | |
| if: (github.ref == 'refs/heads/main' || github.event_name == 'merge_group' || steps.cache-bazel-disk-restore.outputs.cache-matched-key == '') && steps.cache-bazel-disk-restore.outputs.cache-hit != 'true' | |
| with: | |
| path: ~/.cache/bazel-disk | |
| key: bazel-disk-${{ runner.os }}-${{ github.sha }} | |
| - name: 'Upload E2E Screenshots & Diagnostic Logs' | |
| if: always() | |
| uses: 'actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1' # v4.6.1 | |
| with: | |
| name: 'e2e-artifacts' | |
| path: '${{ github.workspace }}/e2e-screenshots/' | |
| if-no-files-found: ignore | |
| retention-days: 14 | |
| run-e2e: | |
| name: 'KinD & Playwright Headless E2E' | |
| needs: | |
| - execute-e2e | |
| if: always() | |
| runs-on: 'ubuntu-latest' | |
| timeout-minutes: 5 | |
| permissions: {} | |
| steps: | |
| - name: 'Verify E2E Status' | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| EXECUTE_RESULT: ${{ needs.execute-e2e.result }} | |
| run: | | |
| if [ "${EVENT_NAME}" = "pull_request" ]; then | |
| echo "Skipping heavy E2E execution on pull_request; full E2E runs in merge_group." | |
| exit 0 | |
| fi | |
| if [ "${EXECUTE_RESULT}" != "success" ]; then | |
| echo "::error::Execute KinD & Playwright Headless E2E finished with status '${EXECUTE_RESULT}'." | |
| exit 1 | |
| fi | |
| echo "Execute KinD & Playwright Headless E2E succeeded." | |