|
| 1 | +name: "🛡️ E2E Tests: Webapp Auth (full)" |
| 2 | + |
| 3 | +# Comprehensive RBAC auth test suite — see TRI-8731. Runs separately from |
| 4 | +# the smoke e2e-webapp.yml because it covers every route family with a |
| 5 | +# pass/fail matrix and would otherwise dominate per-PR CI time. |
| 6 | +# |
| 7 | +# Triggered: |
| 8 | +# - Manually via workflow_dispatch. |
| 9 | +# - Nightly via schedule. |
| 10 | +# - On pull requests touching auth-relevant files only (paths filter). |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +on: |
| 16 | + workflow_dispatch: |
| 17 | + schedule: |
| 18 | + - cron: "0 4 * * *" # 04:00 UTC daily |
| 19 | + pull_request: |
| 20 | + paths: |
| 21 | + - "apps/webapp/app/services/routeBuilders/**" |
| 22 | + - "apps/webapp/app/services/rbac.server.ts" |
| 23 | + - "apps/webapp/app/services/apiAuth.server.ts" |
| 24 | + - "apps/webapp/app/services/personalAccessToken.server.ts" |
| 25 | + - "apps/webapp/app/services/sessionStorage.server.ts" |
| 26 | + - "apps/webapp/app/routes/api.v*.**" |
| 27 | + - "apps/webapp/app/routes/realtime.v*.**" |
| 28 | + - "apps/webapp/test/**/*.e2e.full.test.ts" |
| 29 | + - "apps/webapp/test/setup/global-e2e-full-setup.ts" |
| 30 | + - "apps/webapp/test/helpers/sharedTestServer.ts" |
| 31 | + - "apps/webapp/test/helpers/seedTestSession.ts" |
| 32 | + - "apps/webapp/vitest.e2e.full.config.ts" |
| 33 | + - "internal-packages/rbac/**" |
| 34 | + - "packages/plugins/**" |
| 35 | + - ".github/workflows/e2e-webapp-auth-full.yml" |
| 36 | + |
| 37 | +jobs: |
| 38 | + e2eAuthFull: |
| 39 | + name: "🛡️ E2E Auth Tests (full)" |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 30 |
| 42 | + env: |
| 43 | + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} |
| 44 | + steps: |
| 45 | + - name: 🔧 Disable IPv6 |
| 46 | + run: | |
| 47 | + sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 |
| 48 | + sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 |
| 49 | + sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 |
| 50 | +
|
| 51 | + - name: 🔧 Configure docker address pool |
| 52 | + run: | |
| 53 | + CONFIG='{ |
| 54 | + "default-address-pools" : [ |
| 55 | + { |
| 56 | + "base" : "172.17.0.0/12", |
| 57 | + "size" : 20 |
| 58 | + }, |
| 59 | + { |
| 60 | + "base" : "192.168.0.0/16", |
| 61 | + "size" : 24 |
| 62 | + } |
| 63 | + ] |
| 64 | + }' |
| 65 | + mkdir -p /etc/docker |
| 66 | + echo "$CONFIG" | sudo tee /etc/docker/daemon.json |
| 67 | +
|
| 68 | + - name: 🔧 Restart docker daemon |
| 69 | + run: sudo systemctl restart docker |
| 70 | + |
| 71 | + - name: ⬇️ Checkout repo |
| 72 | + uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + fetch-depth: 0 |
| 75 | + |
| 76 | + - name: ⎔ Setup pnpm |
| 77 | + uses: pnpm/action-setup@v4 |
| 78 | + with: |
| 79 | + version: 10.23.0 |
| 80 | + |
| 81 | + - name: ⎔ Setup node |
| 82 | + uses: buildjet/setup-node@v4 |
| 83 | + with: |
| 84 | + node-version: 20.20.0 |
| 85 | + cache: "pnpm" |
| 86 | + |
| 87 | + - name: 🐳 Login to DockerHub |
| 88 | + if: ${{ env.DOCKERHUB_USERNAME }} |
| 89 | + uses: docker/login-action@v3 |
| 90 | + with: |
| 91 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 92 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 93 | + - name: 🐳 Skipping DockerHub login (no secrets available) |
| 94 | + if: ${{ !env.DOCKERHUB_USERNAME }} |
| 95 | + run: echo "DockerHub login skipped because secrets are not available." |
| 96 | + |
| 97 | + - name: 🐳 Pre-pull testcontainer images |
| 98 | + if: ${{ env.DOCKERHUB_USERNAME }} |
| 99 | + run: | |
| 100 | + docker pull postgres:14 |
| 101 | + docker pull redis:7.2 |
| 102 | + docker pull testcontainers/ryuk:0.11.0 |
| 103 | +
|
| 104 | + - name: 📥 Download deps |
| 105 | + run: pnpm install --frozen-lockfile |
| 106 | + |
| 107 | + - name: 📀 Generate Prisma Client |
| 108 | + run: pnpm run generate |
| 109 | + |
| 110 | + - name: 🏗️ Build Webapp |
| 111 | + run: pnpm run build --filter webapp |
| 112 | + |
| 113 | + - name: 🛡️ Run Webapp Full Auth E2E Tests |
| 114 | + run: cd apps/webapp && pnpm exec vitest run --config vitest.e2e.full.config.ts --reporter=default |
| 115 | + env: |
| 116 | + WEBAPP_TEST_VERBOSE: "1" |
0 commit comments