-
Notifications
You must be signed in to change notification settings - Fork 709
57 lines (48 loc) · 1.79 KB
/
worker-playground-preview-testing-env-deploy-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Deploy (to testing) and Test Playground Preview Worker
# This workflow is designed to deploy a "testing" version of the Playground Preview Worker
# and test it via integration tests.
# Triggers:
# - push to `main`, on Cloudflare, where there are changes to the files in this worker's package
# - update to a PR, on Cloudflare, labelled as `playground-worker`
#
# Actions:
# - deploy to testing environment
# - run the end-to-end tests against testing deployment
on:
push:
branches:
- main
paths:
- "packages/playground-preview-worker/**"
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]
jobs:
e2e-test:
if: github.repository_owner == 'cloudflare' && (github.event_name != 'pull_request' || contains(github.event.*.labels.*.name, 'playground-worker'))
name: "Deploy Playground Preview Worker (testing)"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
- name: Build tools and libraries
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}
- name: Build & deploy Worker
run: pnpm run deploy:testing
env:
NODE_ENV: "production"
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
working-directory: packages/playground-preview-worker
- name: Run tests
run: pnpm run test:e2e
env:
TMP_CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
TMP_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
NODE_OPTIONS: "--max_old_space_size=8192"
working-directory: packages/playground-preview-worker