-
Notifications
You must be signed in to change notification settings - Fork 9
158 lines (116 loc) · 3.37 KB
/
pr.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: CI-pull-requests
on:
pull_request:
branches: [ master ]
merge_group:
types: [ checks_requested ]
env:
NODE_OPTIONS: --max-old-space-size=4096
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'
- name: Install yarn
run: corepack enable
- name: Install dependencies
run: yarn
- name: Lint code
run: yarn lint
tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'
- name: Install yarn
run: corepack enable
- name: Install dependencies
run: yarn
- name: Build shared
run: yarn ligretto-shared:build
- name: Run tests
run: yarn test:ci
- uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Collect coverage from ligretto-gameplay-backend
uses: ArtiomTr/jest-coverage-report-action@v2
with:
prnumber: ${{ steps.findPr.outputs.number }}
skip-step: all
working-directory: apps/ligretto-gameplay-backend
tsc:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'
- name: Install yarn
run: corepack enable
- name: Install dependencies
run: yarn
- name: TS check
run: yarn ts-check
e2e:
env:
NODE_ENV: test
APP_KEY: nwpdmmnko5ylXZt_5CMnofXYUVl9Ppte
services:
postgres:
image: postgres:13.4
ports:
- 5433:5432
env:
POSTGRES_USER: ligretto-core-user
POSTGRES_PASSWORD: ligretto_pg_password
POSTGRES_DB: ligretto-core
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'
- name: Install yarn
run: corepack enable
- name: Install dependencies
run: yarn
- name: Install Playwright Browsers
run: yarn dlx [email protected] install --with-deps chromium
- name: Migrate database
run: yarn ligretto:core-backend:migrate
- name: Start core backend
run: yarn ligretto:core-backend:start:dev &
- name: Check core backend app
run: yarn dlx wait-on --timeout 60000 http-get://127.0.0.1:3333/health
- name: Start gameplay backend
run: yarn ligretto:gameplay-backend:start:dev &
- name: Start frontend
run: yarn ligretto:front:start:dev &
- name: Check frontend app
run: yarn dlx wait-on -c ./apps/ligretto-frontend/waitOnConfig.json --timeout 60000 http-get://127.0.0.1:5173
- name: Run playwright tests
run: yarn e2e:start