Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: CI test for db migration scripts on changes #4739

Merged
merged 9 commits into from
May 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update job
  • Loading branch information
bowenliang123 committed May 28, 2024
commit d6e45e43ac31a39b1688289d01bc0a130ee905ad
15 changes: 9 additions & 6 deletions .github/workflows/db-migration-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: DB migration test
name: DB Migration Test

on:
pull_request:
Expand All @@ -8,7 +8,7 @@ on:
- 'api/migrations/**'

jobs:
test:
db-migration-test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -26,21 +26,24 @@ jobs:
cache: 'pip'
cache-dependency-path: |
./api/requirements.txt
./api/requirements-dev.txt

- name: Install dependencies
run: pip install -r ./api/requirements.txt -r ./api/requirements-dev.txt
run: pip install -r ./api/requirements.txt

- name: Set up DB
- name: Set up Middleware
uses: hoverkraft-tech/compose-action@v2.0.0
with:
compose-file: |
docker/docker-compose.middleware.yaml
services: |
db

- name: Run DB Migration
- name: Prepare configs
run: |
cd api
cp .env.example .env

- name: Run DB Migration
run: |
cd api
flask db upgrade
Loading