feat: TypeORM Package #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Sequelize Migration | |
env: | |
DATABASE_URL: postgres://postgres:password@localhost:5432/sequelize | |
run: pnpm run --filter @timescaledb/example-node-sequelize migrate | |
- name: Run TypeORM Migration | |
env: | |
DATABASE_URL: postgres://postgres:password@localhost:5432/typeorm | |
run: pnpm run --filter @timescaledb/example-node-typeorm migrate | |
- name: Run Sequelize Tests | |
env: | |
DATABASE_URL: postgres://postgres:password@localhost:5432/sequelize | |
run: pnpm run --filter @timescaledb/example-node-sequelize test | |
- name: Run TypeORM Tests | |
env: | |
DATABASE_URL: postgres://postgres:password@localhost:5432/typeorm | |
run: pnpm run --filter @timescaledb/example-node-typeorm test |