Skip to content

add higher-level db migration tests #1

add higher-level db migration tests

add higher-level db migration tests #1

Workflow file for this run

name: Database Migrations
on:
pull_request:
paths:
- .github/workflows/db-migrations.yml
- lib/bin/create-docker-databases.js
- lib/model/migrations/**
- test/db-migrations/**
- package.json
- package-lock.json
- Makefile
push:
paths:
- .github/workflows/db-migrations.yml
- lib/bin/create-docker-databases.js
- lib/model/migrations/**
- test/db-migrations/**
- package.json
- package-lock.json
- Makefile
jobs:
db-migration-tests:
timeout-minutes: 2
# TODO should we use the same container as circle & central?
runs-on: ubuntu-latest
services:
# see: https://docs.github.com/en/[email protected]/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
image: postgres:14.10
env:
POSTGRES_PASSWORD: odktest
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 22.12.0
cache: 'npm'
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- run: make test-db-migrations