From 360784b37195d76b87cf77cdcf912481c7e9eb4d Mon Sep 17 00:00:00 2001 From: CrazyBolillo Date: Tue, 30 Jul 2024 20:33:13 -0600 Subject: [PATCH] ci: test db migration --- .github/workflows/qa.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index 877c220..1e15020 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -39,6 +39,33 @@ jobs: run: sqlc vet - name: Diff run: sqlc diff + dbmate: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:15 + env: + POSTGRES_USER: pbx + POSTGRES_DB: asterisk + POSTGRES_PASSWORD: pbx + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DATABASE_URL: postgres://pbx:pbx@127.0.0.1:5432/asterisk?sslmode=disable + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dbmate + run: npm install dbmate + - name: Run migrations + run: npx dbmate up docker: runs-on: ubuntu-latest steps: