fengmiguoji commited on
Commit
f08aae7
·
verified ·
1 Parent(s): deeba78

Upload .github\workflows\db-migration-test.yml with huggingface_hub

Browse files
.github//workflows//db-migration-test.yml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: DB Migration Test
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ - plugins/beta
8
+ paths:
9
+ - api/migrations/**
10
+ - .github/workflows/db-migration-test.yml
11
+
12
+ concurrency:
13
+ group: db-migration-test-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ db-migration-test:
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+ persist-credentials: false
26
+
27
+ - name: Setup Poetry and Python
28
+ uses: ./.github/actions/setup-poetry
29
+ with:
30
+ poetry-lockfile: api/poetry.lock
31
+
32
+ - name: Install dependencies
33
+ run: poetry install -C api
34
+
35
+ - name: Prepare middleware env
36
+ run: |
37
+ cd docker
38
+ cp middleware.env.example middleware.env
39
+
40
+ - name: Set up Middlewares
41
+ uses: hoverkraft-tech/compose-action@v2.0.2
42
+ with:
43
+ compose-file: |
44
+ docker/docker-compose.middleware.yaml
45
+ services: |
46
+ db
47
+ redis
48
+
49
+ - name: Prepare configs
50
+ run: |
51
+ cd api
52
+ cp .env.example .env
53
+
54
+ - name: Run DB Migration
55
+ env:
56
+ DEBUG: true
57
+ run: |
58
+ cd api
59
+ poetry run python -m flask upgrade-db