-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (57 loc) · 1.64 KB
/
test.js.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
name: Run test
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:12-3.0
env:
POSTGRES_USER: arena
POSTGRES_PASSWORD: arena
POSTGRES_DB: of-arena-test
ports:
- 5444:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- uses: microsoft/playwright-github-action@v1
- uses: actions/setup-node@v3
with:
node-version: '18.12.1'
always-auth: true
auth-token: ${{secrets.ACCESS_TOKEN}}
registry-url: 'https://npm.pkg.github.com'
scope: '@openforis'
- name: Install pm2
run: npm install pm2 -g
- name: Yarn
run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Build
run: yarn build
- name: Run server
run: |
ln -s dist/server.js .
exec pm2-runtime server.js &
env:
PGHOST: localhost
PGPORT: 5444
PGDATABASE: of-arena-test
PGUSER: arena
PGPASSWORD: arena
SESSION_ID_COOKIE_SECRET: my-cookie-secret-key
ADMIN_EMAIL: ${{secrets.ADMIN_EMAIL}}
SENDGRID_API_KEY: ${{secrets.SENDGRID_API_KEY}}
- name: Wait for server to start
run: while ! nc -z localhost 9090; do sleep 5; done;
- name: Run tests
run: yarn test
env:
PGHOST: localhost
PGPORT: 5444
PGDATABASE: of-arena-test
PGUSER: arena
PGPASSWORD: arena