-
Notifications
You must be signed in to change notification settings - Fork 285
48 lines (46 loc) · 1.69 KB
/
test.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
name: test
on: [push, pull_request]
jobs:
test:
name: Test Node v${{ matrix.node }}
strategy:
fail-fast: false
matrix:
node: ['12', '14', '16', '17', '18']
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- run: |
date
sudo cp ./tests/pg_hba.conf /etc/postgresql/14/main/pg_hba.conf
sudo sed -i 's/.*wal_level.*/wal_level = logical/' /etc/postgresql/14/main/postgresql.conf
sudo sed -i 's/.*ssl = .*/ssl = on/' /etc/postgresql/14/main/postgresql.conf
openssl req -new -x509 -nodes -days 365 -text -subj "/CN=localhost" -extensions v3_req -config <(cat /etc/ssl/openssl.cnf <(printf "\n[v3_req]\nbasicConstraints=critical,CA:TRUE\nkeyUsage=nonRepudiation,digitalSignature,keyEncipherment\nsubjectAltName=DNS:localhost")) -keyout server.key -out server.crt
sudo cp server.key /etc/postgresql/14/main/server.key
sudo cp server.crt /etc/postgresql/14/main/server.crt
sudo chmod og-rwx /etc/postgresql/14/main/server.key
sudo systemctl start postgresql.service
pg_isready
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm test
env:
PGUSER: postgres
PGSOCKET: /var/run/postgresql