-
Notifications
You must be signed in to change notification settings - Fork 1.5k
68 lines (59 loc) · 2.19 KB
/
mysql.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: mysql demo db build
on:
pull_request_review:
types: [submitted]
jobs:
mimic-iv-mysql:
# only run if PR is approved
if: github.event.review.state == 'approved'
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Download demo data
uses: ./.github/actions/download-demo
with:
gcp-project-id: ${{ secrets.GCP_PROJECT_ID }}
gcp-sa-key: ${{ secrets.GCP_SA_KEY }}
- name: Extract demo data to local folder
run: |
mv hosp/*.csv.gz ./
mv icu/*.csv.gz ./
mv ed/*.csv.gz ./
gzip -d *.csv.gz
- name: Start MySQL service
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e "SET GLOBAL local_infile=1;"
mysql -u root -proot -e "SET GLOBAL sql_notes=0;"
mysql -u root -proot -e "create database mimic"
- name: Load icu/hosp demo data
run: |
echo "Loading data into mysql."
mysql -u root -proot --local-infile=1 mimic < mimic-iv/buildmimic/mysql/load.sql
mysql -u root -proot mimic < mimic-iv/buildmimic/mysql/validate_demo.sql > results
# if we find "FAILED", then we did not pass the build
if grep -F -q "FAILED" results; then
echo "Failed the following row counts:"
head -n 1 results
grep "FAILED" results
exit 1
else
echo "Built and loaded demo data successfully."
cat results
fi
- name: Load ed demo data
run: |
echo "Loading data into mysql."
mysql -u root -proot --local-infile=1 mimic < mimic-iv-ed/buildmimic/mysql/load.sql
mysql -u root -proot mimic < mimic-iv-ed/buildmimic/mysql/validate_demo.sql > results
# if we find "FAILED", then we did not pass the build
if grep -F -q "FAILED" results; then
echo "Failed the following row counts:"
head -n 1 results
grep "FAILED" results
exit 1
else
echo "Built and loaded demo data successfully."
cat results
fi