-
Notifications
You must be signed in to change notification settings - Fork 9
129 lines (95 loc) · 2.95 KB
/
ligretto-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
name: 'Ligretto pull request'
on:
pull_request:
branches: [ master ]
paths:
- 'apps/ligretto-**'
- 'packages/ligretto-shared/**'
- 'packages/auth-front/**'
- 'packages/ui/**'
- '.docker/Ligretto-**'
- .github/workflows/ligretto-pr.yml
- '.env*'
- 'yarn.lock'
env:
NODE_OPTIONS: --max-old-space-size=4096
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js
- name: Lint code
run: yarn lint
tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js
- name: Build shared
run: yarn ligretto-shared:build
- name: Run tests
run: yarn ligretto: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-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js
- name: TS check
run: yarn ligretto:ts-check:ci
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-22.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@main
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js
- name: Install Playwright Browsers
run: yarn dlx playwright@1.42.1 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