-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (46 loc) · 1.53 KB
/
macos.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
name: macOS
on: [push, pull_request]
jobs:
test:
name: Node ${{ matrix.node-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
os: [macos-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: PostgreSQL Setup
run: |
brew install postgresql@14
brew services start postgresql@14
echo "Check PostgreSQL service is running"
i=10
COMMAND='pg_isready'
while [ $i -gt 0 ]; do
echo "Check PostgreSQL service status"
eval $COMMAND && break
((i--))
if [ $i == 0 ]; then
echo "PostgreSQL service not ready, all attempts exhausted"
exit 1
fi
echo "PostgreSQL service not ready, wait 10 more sec, attempts left: $i"
sleep 10
done
psql --command="CREATE USER testuser PASSWORD 'testpassword'" --command="\du" postgres
createdb --owner=testuser testdatabase
PGPASSWORD=testpassword psql --username=testuser --host=localhost --list testdatabase
- name: npm install
run: npm i
- name: npm run build
run: npm run build
- name: npm test
run: npm test
env:
TEST_ONLINE: postgresql://testuser:testpassword@localhost:5432/testdatabase