This repository was archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.36 KB
/
ci.yaml
File metadata and controls
46 lines (45 loc) · 1.36 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
#
# learning-sql
# continuous integation pipeline
#
name: "Learning SQL CI"
on:
push: {}
jobs:
run-exercises:
name: "CI: Run Exercises"
runs-on: ubuntu-20.04
env:
MYSQL_USER: mariadb
MYSQL_PASSWORD: kx8hquwLaJ73ebN9uFkJ
MYSQL_ROOT_PASSWORD: ruR62KHi5eMmHAWTY5Lc
MYSQL_PORT: 3306
services:
mysql:
image: mariadb:10.6.3
env:
MYSQL_USER: ${{ env.MYSQL_USER }}
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
MYSQL_ROOT_PASSWORD: ${{ env.MYSQL_ROOT_PASSWORD }}
ports:
- 3306:3306
steps:
- uses: actions/checkout@v2
- name: "Download & Extract Sakila Database"
run: |
make download-sakila
- name: "Wait for MySQL to initialize & Grant all privilleges to 'mariadb' user "
run: |
CONNECTION_OPTS="--host=localhost --port=$MYSQL_PORT --protocol=tcp --user=root --password=$MYSQL_ROOT_PASSWORD"
# while loop required to poll MySQL until it finishes initialization
while ! echo "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'%';" | mysql ${CONNECTION_OPTS}
do
echo "Waiting 5s for MySQL to initialize"
sleep 5
done
- name: "Import Sakila Database Schema & Data"
run: |
make load-sakila
- name: "Run exercises"
run: |
make run