-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.78 KB
/
playwright-pull-request-tests.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
name: E2E Tests on pull request to main
on:
pull_request:
branches: [main]
env:
CI: true
NEXT_PUBLIC_ENV: "development"
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
STRIPE_API_KEY: ${{secrets.STRIPE_API_KEY}}
jobs:
playwright-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 22.12.0
cache: "npm"
- name: Install dependencies
run: npm install -D
- name: Install vercel cli
run: npm install --global vercel@latest
- name: Pull Vercel preview environment
run: vercel env pull --yes .env.ci --environment=preview --git-branch=${{ github.head_ref }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Install Stripe CLI
run: |
curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg
echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list
sudo apt update
sudo apt upgrade
sudo apt install stripe
# - name: Drizzle push to db branch
# run: npm run db:push
- name: Install Playwright Browsers
run: npm run e2e:install
- name: Run Playwright tests
run: npm run e2e:ci