2023-11-30 18:20:13 +01:00
|
|
|
name: Test db migrations
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- 'src/migrations/**'
|
|
|
|
- '.github/workflows/validate-migrations.yaml'
|
|
|
|
- 'test-migrations/**'
|
|
|
|
- 'frontend/cypress'
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
test-migrations:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-05-23 14:14:09 +02:00
|
|
|
- name: Use Node.js 20.x
|
2024-01-17 08:56:41 +01:00
|
|
|
uses: actions/setup-node@v4
|
2023-11-30 18:20:13 +01:00
|
|
|
with:
|
2024-06-12 11:18:21 +02:00
|
|
|
node-version: 20.x
|
|
|
|
cache: 'yarn'
|
2023-11-30 18:20:13 +01:00
|
|
|
- name: Start database
|
|
|
|
working-directory: test-migrations
|
|
|
|
run: docker compose up db -d --wait -t 90
|
|
|
|
- name: Start stable version of Unleash
|
|
|
|
working-directory: test-migrations
|
|
|
|
run: docker compose up unleash -d --wait -t 90
|
|
|
|
# add some data with terraform
|
|
|
|
- name: Apply migrations
|
|
|
|
env:
|
2024-06-12 11:18:21 +02:00
|
|
|
DATABASE_URL: postgres://postgres:unleash@localhost:5432/unleash
|
|
|
|
DATABASE_SSL: false
|
|
|
|
YARN_ENABLE_SCRIPTS: false
|
2023-11-30 18:20:13 +01:00
|
|
|
run: |
|
2024-06-12 11:18:21 +02:00
|
|
|
yarn install --immutable
|
2023-11-30 18:20:13 +01:00
|
|
|
yarn db-migrate up
|
|
|
|
# run ui tests against previous version of Unleash
|
|
|
|
- name: Run Cypress
|
2024-06-12 11:18:21 +02:00
|
|
|
uses: cypress-io/github-action@v6
|
2023-11-30 18:20:13 +01:00
|
|
|
with:
|
|
|
|
working-directory: frontend
|
|
|
|
env: AUTH_USER=admin,AUTH_PASSWORD=unleash4all
|
|
|
|
config: baseUrl=http://localhost:4242
|
|
|
|
spec: cypress/oss/**/*.spec.ts
|
2024-06-12 11:18:21 +02:00
|
|
|
install-command: yarn --immutable
|