Skip to content

db-migrations: use pg for new migrations #37

db-migrations: use pg for new migrations

db-migrations: use pg for new migrations #37

# This is a test of legacy migrations in various states.
# This test workflow should not be required after knex has been removed.
name: Partial Database Migrations
on:
push:
pull_request:
jobs:
db-partial-migration-tests:
strategy:
matrix:
previous-migrations:
- none
- legacy-first-1
- legacy-first-10
- legacy-first-100
- legacy-all
- new-first-1-as-legacy
- new-first-10-as-legacy
- all
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:
- run: sudo apt-get install tree
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 22.14.0
cache: 'npm'
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- run: test/db-partial-migrations/test.sh ${{ matrix.previous-migrations }}