forked from DOMjudge/domjudge
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.24 KB
/
database-upgrade.yml
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
name: Database Upgrade Test
on:
push:
branches:
- main
- '[0-9]+.[0-9]+'
- oldDBCI
pull_request:
branches:
- main
- '[0-9]+.[0-9]+'
jobs:
upgrade_test:
runs-on: ubuntu-latest
container:
image: domjudge/gitlabci:24.04
services:
sqlserver:
image: mariadb
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: domjudge
MYSQL_PASSWORD: domjudge
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Wait and Import Database
run: |
apt-get update
apt-get install -y default-mysql-client
while ! mysqladmin ping -h"sqlserver" -u"root" -p"root" --silent; do
echo "Waiting for database connection..."
sleep 2
done
mysql -hsqlserver -u"root" -p"root" < .github/jobs/old_database.sql
- name: Install DOMjudge
run: .github/jobs/upgradeinstall.sh
- name: Check for Errors in the Upgrade
run: |
mysql -hsqlserver -u"root" -p"root" -e "SHOW TABLES FROM domjudge;"