-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (67 loc) · 2.39 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
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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
timescaledb:
image: timescale/timescaledb-ha:pg17
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-project
- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Wait for TimescaleDB
run: |
timeout=30
counter=0
until PGPASSWORD=password psql -h localhost -U postgres -c '\dx' postgres | grep timescaledb; do
counter=$((counter + 1))
if [ $counter -gt $timeout ]; then
echo "Timeout waiting for TimescaleDB"
exit 1
fi
echo "Waiting for TimescaleDB... ($counter/$timeout)"
sleep 1
done
- name: Create Databases
run: |
PGPASSWORD=password psql -h localhost -U postgres -c 'CREATE DATABASE sequelize;' postgres
PGPASSWORD=password psql -h localhost -U postgres -c 'CREATE DATABASE typeorm;' postgres
- name: Run Core Package Tests
run: pnpm run --filter @timescaledb/core test
- name: Run TypeORM Lib Tests
run: pnpm run --filter @timescaledb/typeorm test
- name: Run TypeORM Migration
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/typeorm
run: pnpm run --filter @timescaledb/example-node-typeorm migrate
- name: Run TypeORM Example Tests
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/typeorm
run: pnpm run --filter @timescaledb/example-node-typeorm test
- name: Run Sequelize Migration
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sequelize
run: pnpm run --filter @timescaledb/example-node-sequelize migrate
- name: Run Sequelize Example Tests
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sequelize
run: pnpm run --filter @timescaledb/example-node-sequelize test