Repository navigation
144 lines (127 loc) · 4.18 KB
/
Copy pathe2e.yml
File metadata and controls
144 lines (127 loc) · 4.18 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: E2E
on:
workflow_dispatch:
inputs:
target:
description: E2E target to run
required: true
type: choice
default: all
options:
- all
- cli
- stripe
permissions: {}
jobs:
cli:
name: CLI E2E
if: ${{ github.event_name != 'workflow_dispatch' || inputs.target == 'all' || inputs.target == 'cli' }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-cli
cancel-in-progress: false
timeout-minutes: 30
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/postgres
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: pnpm
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Run database migration tests
run: pnpm --filter e2e test:database
- name: Validate CLI E2E configuration
env:
E2E_STRIPE_SK: ${{ secrets.E2E_STRIPE_SK }}
E2E_STRIPE_WHSEC: ${{ secrets.E2E_STRIPE_WHSEC }}
run: |
set -euo pipefail
for name in E2E_STRIPE_SK E2E_STRIPE_WHSEC TEST_DATABASE_URL; do
if [ -z "${!name:-}" ]; then
echo "::error::Missing required configuration: $name"
exit 1
fi
done
- name: Run CLI E2E suite
env:
E2E_STRIPE_SK: ${{ secrets.E2E_STRIPE_SK }}
E2E_STRIPE_WHSEC: ${{ secrets.E2E_STRIPE_WHSEC }}
run: pnpm --filter e2e test:cli
stripe:
name: Stripe E2E
if: ${{ github.event_name != 'workflow_dispatch' || inputs.target == 'all' || inputs.target == 'stripe' }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-stripe
cancel-in-progress: false
timeout-minutes: 60
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/postgres
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: pnpm
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Setup cloudflared
uses: AnimMouse/setup-cloudflared@b80ad7aa7850e1ec9960d75831f32ac9855df988 # v2
- name: Install Playwright Chromium
run: pnpm --filter e2e exec playwright install --with-deps chromium
- name: Run Stripe E2E suite
env:
CF_TUNNEL_TOKEN: ${{ secrets.CF_TUNNEL_TOKEN_STRIPE }}
E2E_STRIPE_SK: ${{ secrets.E2E_STRIPE_SK }}
E2E_STRIPE_WHSEC: ${{ secrets.E2E_STRIPE_WHSEC }}
run: pnpm --filter e2e test:stripe
- name: Upload cloudflared log
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
if-no-files-found: ignore
name: stripe-e2e-cloudflared-log
path: cloudflared.log