-
Notifications
You must be signed in to change notification settings - Fork 270
69 lines (55 loc) · 1.74 KB
/
web-shortest.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
name: "Web / Tests"
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
shortest:
name: "End-to-end"
# Skip running on forks, as there is no access to secrets
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
timeout-minutes: 10
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Pull and set up .env.local
run: |
pnpm dlx vercel pull --environment=preview --token=$VERCEL_TOKEN
cp .vercel/.env.preview.local .env.local
test -f .env.local || (echo ".env.local not created" && exit 1)
- name: Set up database
run: |
pnpm drizzle-kit generate
pnpm db:migrate
pnpm db:seed
- name: Install Playwright
run: pnpm exec playwright install chromium
- name: Build app
run: pnpm build
- name: Start app in background
run: pnpm start -p 3000 & sleep 10
- name: Run Shortest tests
run: pnpm nextjs:test:e2e --headless --log-level=debug
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: artifacts
path: .shortest
if-no-files-found: error
include-hidden-files: true
retention-days: 7