-
Notifications
You must be signed in to change notification settings - Fork 33
130 lines (117 loc) · 4.73 KB
/
e2e-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
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
name: E2E Tests
permissions:
contents: write
packages: write
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
e2e-tests:
if: github.actor != 'renovate[bot]'
timeout-minutes: 60
env:
CI: true
ESLINT_USE_FLAT_CONFIG: true
SUPABASE_URL: http://localhost:54321
VITE_PORT: 5173
VITE_BASE_URL: http://localhost:5173
VITE_RECOVERY_AUTH_REDIRECT_URL: http://localhost:5173/profile/reset-password
VITE_SUPABASE_URL: http://localhost:54321
TEST_SUPABASE_INBUCKET_URL: http://localhost:54324
# The values below are taken from the command `supabase start`
# WARNING: Don't use production URLs or tokens here
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
VITE_SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
SUPABASE_SERVICE_ROLE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
VITE_MATOMO_SITE_ID: ""
VITE_MATOMO_URL: ""
VITE_MAP_BOUNDING_BOX: "13.0824446341071,52.3281202651866,13.7682544186827,52.681600197973"
VITE_MAP_CENTER_LNG: "13.388836926491992"
VITE_MAP_CENTER_LAT: "52.494590307846366"
VITE_MAPBOX_API_ENDPOINT: "https://api.mapbox.com"
VITE_MAP_PITCH_DEGREES: "45"
VITE_MAP_MAX_ZOOM_LEVEL: "20"
VITE_MAP_MIN_ZOOM_LEVEL: "10"
VITE_MAP_INITIAL_ZOOM_LEVEL: "11"
VITE_MAP_LOCATION_ZOOM_LEVEL: "17"
VITE_MAPBOX_API_KEY: ${{ secrets.VITE_MAPBOX_API_KEY }}
VITE_MAPBOX_STYLE_URL: ${{ secrets.VITE_MAPBOX_STYLE_URL }}
VITE_MAPBOX_TREES_TILESET_URL: ${{ secrets.VITE_MAPBOX_TREES_TILESET_URL }}
VITE_MAPBOX_TREES_TILESET_LAYER: ${{ secrets.VITE_MAPBOX_TREES_TILESET_LAYER }}
VITE_MAP_PUMPS_SOURCE_URL: ${{ secrets.VITE_MAP_PUMPS_SOURCE_URL }}
VITE_PW_TEST: "true"
SUPABASE_MAX_ROWS: 10000
# Set to scheme, domain and possibly port (if something else than port 80) of the origin you are expecting
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
ACCESS_CONTROL_ALLOW_ORIGIN: "*"
runs-on: ubuntu-latest
steps:
- name: Checkout code ⬇️
uses: actions/checkout@v4
- name: Setup Node.js using .nvmrc ⚙️
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: npm
- name: Setup tmate session so you can ssh into the workflow machine ⚙️
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true
# please see https://github.com/mxschmitt/action-tmate
- name: Cache npm dependencies 💾
id: cache-npm-deps
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies 📦
if: steps.cache-npm-deps.outputs.cache-hit != 'true'
run: npm ci
- name: Check Build 🏗️
run: npm run build
- name: Get the source for the api ⬇️
id: checkout-api
uses: actions/checkout@v4
with:
repository: technologiestiftung/giessdenkiez-de-postgres-api
ref: "staging"
path: api
- name: Install Supabase CLI ⚙️
uses: supabase/setup-cli@v1
with:
version: 1.178.2
- name: Start supabase ⚡️
run: |
cd api
npm ci
supabase start
- name: Install Playwright Browsers 🧭
run: npx playwright install --with-deps
- name: Run E2E test 🎭
run: npm run test:e2e
- name: Upload E2E test results ⬆️
uses: actions/upload-artifact@v4
if: ${{ failure() && !cancelled() }}
with:
name: playwright-e2e-test-results
path: tests/e2e/test-results
retention-days: 30
- name: Start Tmate session 🔌
if: ${{ failure() && !cancelled() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
with:
limit-access-to-actor: true