-
-
Notifications
You must be signed in to change notification settings - Fork 652
110 lines (96 loc) · 2.86 KB
/
Copy pathmigrations.yml
File metadata and controls
110 lines (96 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Run Migrations
on:
pull_request:
paths:
- "backend/alembic/versions/**"
permissions: read-all
jobs:
migrate-postgres:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install mariadb connectors
run: |
sudo apt-get update
sudo apt-get install -y libmariadb3 libmariadb-dev
- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
- name: Install python
run: uv python install 3.13
- name: Install dependencies
run: uv sync
- name: Run PostgreSQL Migrations
working-directory: backend
env:
ROMM_DB_DRIVER: postgresql
DB_HOST: localhost
DB_PORT: 5432
DB_USER: user
DB_PASSWD: password
DB_NAME: testdb
ROMM_AUTH_SECRET_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ROMM_BASE_PATH: romm_test
run: uv run alembic upgrade head
migrate-mariadb:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
services:
mariadb:
image: mariadb:10.11
env:
MARIADB_USER: user
MARIADB_PASSWORD: password
MARIADB_DATABASE: testdb
MARIADB_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -u root --password=root"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Install mariadb connectors
run: |
sudo apt-get update
sudo apt-get install -y libmariadb3 libmariadb-dev
- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
- name: Install python
run: uv python install 3.13
- name: Install dependencies
run: uv sync
- name: Run MariaDB Migrations
working-directory: backend
env:
ROMM_DB_DRIVER: mariadb
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: user
DB_PASSWD: password
DB_NAME: testdb
ROMM_AUTH_SECRET_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ROMM_BASE_PATH: romm_test
run: uv run alembic upgrade head