-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.61 KB
/
main.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
# The service containers will use host port binding instead of container networking so you access them via localhost rather than the service name
jobs:
vm-job:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
node-version: [18.x, 20.x]
services:
postgres:
image: postgis/postgis:16-3.4
#image: postgres:10.8
env:
POSTGRES_USER: api
POSTGRES_PASSWORD: api
POSTGRES_DB: prostgles_server_tests
ports:
# will assign a random free host port
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v1
- run: npm ci
# working-directory: ./postgres
- run: npm test
# working-directory: ./postgres
env:
# use localhost for the host here because we are running the job on the VM.
# If we were running the job on in a container this would be postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port