-
Notifications
You must be signed in to change notification settings - Fork 6
144 lines (141 loc) · 4.08 KB
/
check-sanity.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Check - Sanity Tests
on:
push:
branches:
- main
paths:
- 'apis/**'
- 'pages/**'
- 'tests/**'
- 'utils/**'
- '.github/workflows/sanity-check.yml'
- 'playwright.config.ts'
- 'package-lock.json'
- 'package.json'
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- labeled
jobs:
install:
name: Install
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repository
id: checkout-repository
uses: actions/checkout@v4
- name: Setup Node
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Cache Playwright Binaries
id: cache-playwright
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: playwright-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
id: install-dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Install Playwright Browsers
id: install-playwright-browsers
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run Type Checks
id: run-type-checks
run: npx tsc -p tsconfig.json --noEmit
test:
name: Sanity Tests
runs-on: ubuntu-latest
needs: [install]
timeout-minutes: 60
services:
rbp-booking:
image: mwinteringham/restfulbookerplatform_booking:1.6.24c7b22
ports:
- 3000:3000
rbp-room:
image: mwinteringham/restfulbookerplatform_room:1.6.24c7b22
ports:
- 3001:3001
rbp-branding:
image: mwinteringham/restfulbookerplatform_branding:1.6.24c7b22
ports:
- 3002:3002
rbp-assets:
image: mwinteringham/restfulbookerplatform_assets:1.6.24c7b22
ports:
- 3003:3003
rbp-auth:
image: mwinteringham/restfulbookerplatform_auth:1.6.24c7b22
ports:
- 3004:3004
rbp-report:
image: mwinteringham/restfulbookerplatform_report:1.6.24c7b22
ports:
- 3005:3005
rbp-message:
image: mwinteringham/restfulbookerplatform_message:1.6.24c7b22
ports:
- 3006:3006
rbp-proxy:
image: mwinteringham/restfulbookerplatform_proxy:latest
ports:
- 80:80
steps:
- name: Checkout Repository
id: checkout-repository
uses: actions/checkout@v4
- name: Setup Node
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Cache Playwright Binaries
id: cache-playwright
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: playwright-${{ hashFiles('package-lock.json') }}
# Playwright caches the browser binaries, but not their dependencies.
# Those extra browser dependencies must be installed separately when the cached browsers are restored.
- name: Install Playwright System Dependencies
id: install-playwright-system-dependencies
run: npx playwright install-deps
- name: Run Playwright Tests
id: run-playwright-tests
run: npx playwright test --grep @sanity
env:
ENV: local
- name: Upload Playwright HTML Report
id: upload-playwright-html-report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
if-no-files-found: ignore
retention-days: 1