-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (120 loc) · 4.07 KB
/
test-and-typecheck.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
name: Test, Lint and Typecheck
on: [push]
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 # needed until 18 becomes the default
with:
node-version: 18
cache: yarn
- name: Install node-gyp # needed for apollo server
run: yarn global add node-gyp
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Typecheck
run: yarn ts:check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 # needed until 18 becomes the default
with:
node-version: 18
cache: yarn
- name: Install node-gyp # needed for apollo server
run: yarn global add node-gyp
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Typecheck
run: yarn lint
test:
runs-on: ubuntu-latest
env:
POSTMARK_API_KEY: ${{ secrets.POSTMARK_API_KEY }}
FROM_EMAIL: ${{ secrets.FROM_EMAIL }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 # needed until 18 becomes the default
with:
node-version: 18
cache: yarn
- name: Setup .env
run: cp apps/backend/.env.example apps/backend/.env
- name: Run Database
run: docker-compose up -d
- name: Install node-gyp # needed for apollo server
run: yarn global add node-gyp
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: NODE log
run: node -v
- name: Test
run: yarn test
timeout-minutes: 10
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 # needed until 18 becomes the default
with:
node-version: 18
cache: yarn
- name: Install node-gyp # needed for apollo server
run: yarn global add node-gyp
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test
run: yarn prettier:check
e2e-test:
runs-on: ubuntu-latest
environment: e2e-tests
env:
FILE_STORAGE_ACCOUNT_ID: ${{ secrets.FILE_STORAGE_ACCOUNT_ID }}
FILE_STORAGE_ACCESS_KEY_ID: ${{ secrets.FILE_STORAGE_ACCESS_KEY_ID }}
FILE_STORAGE_SECRET_ACCESS_KEY: ${{ secrets.FILE_STORAGE_SECRET_ACCESS_KEY }}
FILE_STORAGE_BUCKET: ${{ vars.FILE_STORAGE_BUCKET }}
POSTMARK_API_KEY: ${{ secrets.POSTMARK_API_KEY }}
FROM_EMAIL: ${{ secrets.FROM_EMAIL }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3 # needed until 18 becomes the default
with:
node-version: 18
cache: yarn
- name: Setup .env
run: cp apps/backend/.env.example apps/backend/.env
- name: Run Database
run: docker-compose up -d
- name: Install node-gyp # needed for apollo server
run: yarn global add node-gyp
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build backend
run: yarn workspace backend build
- name: Run backend
run: yarn workspace backend start:e2e &
- name: Build frontend
run: yarn workspace serenity build:web:e2e
- name: Run frontend
run: yarn workspace serenity start:e2e &
- name: Sleep for 5 seconds
run: sleep 5s
shell: bash
- name: Curl backend
run: curl http://localhost:4001/graphql
- name: Curl frontend
run: curl --fail-with-body http://localhost:19006
- name: Echo SERENITY_ENV
run: echo $SERENITY_ENV
- name: Run e2e tests
# run: yarn workspace backend test:e2e test/e2e/authentication/login.e2e.ts
run: yarn workspace backend test:e2e
- name: Upload artifacts
if: always() # to make sure it runs even if the e2e tests fail
uses: actions/upload-artifact@v3
with:
path: apps/backend/test-results/**/*