-
Notifications
You must be signed in to change notification settings - Fork 6
107 lines (107 loc) · 3.27 KB
/
ci.yml
File metadata and controls
107 lines (107 loc) · 3.27 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test -- --run
bundle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- run: pnpm test:bundle
visual:
runs-on: ubuntu-latest
needs: [check]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: npx playwright install --with-deps chromium
- name: Build Storybook
run: pnpm build-storybook
- name: Run visual regression tests
run: |
npx http-server storybook-static --port 6099 --silent &
npx wait-on http://localhost:6099/index.json --timeout 30000
pnpm test:visual
env:
STORYBOOK_URL: http://localhost:6099
BASE_URL: http://localhost:6099
- name: Upload diff artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: visual-regression-diffs
path: test-results/
retention-days: 14
e2e:
runs-on: ubuntu-latest
needs: [check, bundle]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: npx playwright install --with-deps chromium
- name: Run unauthenticated E2E tests
run: pnpm test:e2e -- e2e/auth.spec.ts e2e/public-routes.spec.ts
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY }}
gate:
if: always()
runs-on: ubuntu-latest
needs: [check, bundle, e2e, visual]
steps:
- name: Check required jobs
run: |
if [[ "${{ needs.check.result }}" != "success" ]]; then
echo "check job failed"
exit 1
fi
if [[ "${{ needs.bundle.result }}" != "success" ]]; then
echo "bundle job failed"
exit 1
fi
if [[ "${{ needs.e2e.result }}" != "success" ]]; then
echo "e2e job failed"
exit 1
fi
if [[ "${{ needs.visual.result }}" != "success" ]]; then
echo "visual job failed"
exit 1
fi
echo "All required jobs passed"