|
63 | 63 | - name: Run container unit tests |
64 | 64 | run: npm run test -w @repo/sandbox-container |
65 | 65 |
|
66 | | - # E2E tests run in parallel with unit tests |
67 | | - e2e-tests: |
68 | | - if: ${{ github.repository_owner == 'cloudflare' }} |
69 | | - runs-on: ubuntu-latest |
70 | | - timeout-minutes: 30 |
71 | | - |
72 | | - steps: |
73 | | - - uses: actions/checkout@v4 |
74 | | - |
75 | | - - uses: actions/setup-node@v4 |
76 | | - with: |
77 | | - node-version: 24 |
78 | | - cache: "npm" |
79 | | - |
80 | | - - uses: oven-sh/setup-bun@v2 |
81 | | - with: |
82 | | - bun-version: latest |
83 | | - |
84 | | - - name: Install dependencies |
85 | | - run: npm ci |
86 | | - |
87 | | - - name: Build packages |
88 | | - run: npm run build |
89 | | - |
90 | | - - name: Set worker name |
91 | | - id: worker-name |
92 | | - run: | |
93 | | - # Use git SHA for unique, meaningful naming (not sequential run number) |
94 | | - SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) |
95 | | - echo "worker_name=sandbox-e2e-test-worker-release-${SHORT_SHA}" >> $GITHUB_OUTPUT |
96 | | -
|
97 | | - # Generate unique wrangler config for this release |
98 | | - - name: Generate wrangler config |
99 | | - run: | |
100 | | - cd tests/e2e/test-worker |
101 | | - ./generate-config.sh ${{ steps.worker-name.outputs.worker_name }} |
102 | | -
|
103 | | - - name: Build test worker Docker image |
104 | | - run: npm run docker:local -w @cloudflare/sandbox |
105 | | - |
106 | | - - name: Deploy test worker |
107 | | - uses: cloudflare/wrangler-action@v3 |
108 | | - with: |
109 | | - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
110 | | - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
111 | | - command: deploy --name ${{ steps.worker-name.outputs.worker_name }} |
112 | | - workingDirectory: tests/e2e/test-worker |
113 | | - |
114 | | - - name: Get deployment URL |
115 | | - id: get-url |
116 | | - run: | |
117 | | - echo "worker_url=https://${{ steps.worker-name.outputs.worker_name }}.agents-b8a.workers.dev" >> $GITHUB_OUTPUT |
118 | | -
|
119 | | - - name: Run E2E tests |
120 | | - run: npx vitest run --config vitest.e2e.config.ts |
121 | | - env: |
122 | | - TEST_WORKER_URL: ${{ steps.get-url.outputs.worker_url }} |
123 | | - CI: true |
124 | | - |
125 | | - - name: Cleanup test deployment |
126 | | - if: always() |
127 | | - continue-on-error: true |
128 | | - run: | |
129 | | - cd tests/e2e/test-worker |
130 | | - ../../../scripts/cleanup-test-deployment.sh ${{ steps.worker-name.outputs.worker_name }} |
131 | | - env: |
132 | | - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
133 | | - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
134 | | - |
135 | 66 | # Prerelease publish - always runs after tests pass |
136 | 67 | publish-prerelease: |
137 | | - needs: [unit-tests, e2e-tests] |
| 68 | + needs: [unit-tests] |
138 | 69 | if: ${{ github.repository_owner == 'cloudflare' }} |
139 | 70 | runs-on: ubuntu-latest |
140 | 71 | timeout-minutes: 20 |
@@ -185,7 +116,7 @@ jobs: |
185 | 116 |
|
186 | 117 | # Release publish - only runs if changesets exist |
187 | 118 | publish-release: |
188 | | - needs: [unit-tests, e2e-tests] |
| 119 | + needs: [unit-tests] |
189 | 120 | if: ${{ github.repository_owner == 'cloudflare' }} |
190 | 121 | runs-on: ubuntu-latest |
191 | 122 | timeout-minutes: 20 |
|
0 commit comments