1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

Add workflow running dbcritic on migration updates

This commit is contained in:
Christopher Kolstad 2021-09-08 13:19:15 +02:00
parent 6ae49c44d0
commit 9858bc7bfa
No known key found for this signature in database
GPG Key ID: 559ACB0E3DB5538A

52
.github/workflows/dbcritic.yaml vendored Normal file
View File

@ -0,0 +1,52 @@
name: dbcritic
on:
push:
branches:
- master
paths:
- src/migrations/**
pull_request:
paths:
- src/migrations/**
jobs:
dbcritic:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install deps
run: yarn install
- name: Run db migration
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
run: yarn db-migrate up
- name: Run dbcritic
uses: chriswk/dbcritic@v3
env:
PGPASS: postgres
PGPORT: 5432
PGHOST: localhost
PGUSER: postgres
PGDATABASE: postgres