-
Notifications
You must be signed in to change notification settings - Fork 553
/
action.yml
81 lines (74 loc) · 2.46 KB
/
action.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: "Run C3 E2E Tests"
description: "Runs the C3 E2E tests on npm, pnpm, and bun"
inputs:
packageManager:
description: "Which package manager to run the tests with"
required: true
packageManagerVersion:
description: "Which package manager version to run the tests with"
required: true
quarantine:
description: "Whether to run the tests in quarantine mode"
required: false
framework:
description: "When specified, will only run tests for this framework"
required: false
accountId:
description: "The account id of the test account"
required: true
apiToken:
description: "The api token of the test account"
required: true
saveDiffs:
description: "Whether to retain diffs of framework templates during run"
required: true
runs:
using: "composite"
steps:
- if: ${{ inputs.packageManager == 'bun' }}
name: Install Bun ${{ inputs.packageManagerVersion }}
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ inputs.packageManagerVersion }}
# Needed because gatsby requires git
- name: Configure Git
shell: bash
run: |
git config --global user.email wrangler@cloudflare.com
git config --global user.name 'Wrangler automated PR updater'
- name: Build
shell: bash
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}
- name: E2E Tests
id: run-e2e
shell: bash
run: pnpm run test:e2e --filter create-cloudflare
env:
CLOUDFLARE_API_TOKEN: ${{ inputs.apiToken }}
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.accountId }}
E2E_QUARANTINE: ${{ inputs.quarantine }}
FRAMEWORK_CLI_TO_TEST: ${{ inputs.framework }}
TEST_PM: ${{ inputs.packageManager }}
TEST_PM_VERSION: ${{ inputs.packageManagerVersion }}
SAVE_DIFFS: ${{ inputs.saveDiffs }}
CI_OS: ${{ runner.os }}
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: e2e-logs-${{matrix.os}}
path: packages/create-cloudflare/.e2e-logs
- name: Upload Framework Diffs
if: ${{ steps.run-e2e.outcome == 'success' && inputs.saveDiffs == 'true' }}
uses: actions/upload-artifact@v3
with:
name: e2e-framework-diffs
path: packages/create-cloudflare/.e2e-diffs
overwrite: true
- name: Fail if errors detected
shell: bash
if: ${{ steps.run-e2e.outcome == 'failure' }}
run: exit 1