-
Notifications
You must be signed in to change notification settings - Fork 59
87 lines (78 loc) · 2.77 KB
/
visual-tests-schedule.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
82
83
84
85
86
87
name: Playwright Visual Tests (Scheduled)
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
# Required to build test/next
POSTGRES_URL: ${{ secrets.POSTGRES_URL }}
# Required to build test/next
POSTGRES_URL_NON_POOLING: ${{ secrets.POSTGRES_URL_NON_POOLING }}
# Required to build test/next
EDGE_CONFIG: ${{ secrets.EDGE_CONFIG }}
PLAYWRIGHT_TEST_MATCH: '**/*.visual.test.ts'
PLAYWRIGHT_PROJECT: 'Desktop Chrome'
on:
schedule:
- cron: '*/5 * * * *'
workflow_dispatch:
inputs:
PLAYWRIGHT_TEST_BASE_URL:
description: 'Test url'
type: string
required: false
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install
# This will use the cache for browsers. But it will reinstall system deps, which can't be cached
# https://github.com/microsoft/playwright/issues/20603#issuecomment-1416243810
# Using ./test/next... is mandatory so we are not subject to playwright surprise updates
- run: ./test/next/node_modules/.bin/playwright install --with-deps
- name: Run Playwright tests on https://storage-rho.vercel.app/
run: pnpm integration-test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{inputs.PLAYWRIGHT_TEST_BASE_URL || 'https://storage-rho.vercel.app' }}
- name: Datadog report Fail
uses: masci/datadog@v1
if: failure()
with:
api-key: ${{ secrets.DATADOG_API_KEY }}
service-checks: |
- check: "blob.storage.load.image"
message: "Blob image Visual test failed"
status: 2
host_name: ${{ github.repository_owner }}
tags:
- "project:${{ github.repository }}"
- name: Datadog report Success
uses: masci/datadog@v1
with:
api-key: ${{ secrets.DATADOG_API_KEY }}
service-checks: |
- check: "blob.storage.load.image"
message: "Blob image Visual test succeeded"
status: 0
host_name: ${{ github.repository_owner }}
tags:
- "project:${{ github.repository }}"
- name: Upload Snpashot results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-snapshot
path: test/next/test-results