-
Notifications
You must be signed in to change notification settings - Fork 68
101 lines (101 loc) · 3.84 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
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
name: MySQL Integration Tests
on:
pull_request:
paths:
- 'sql/tests/**'
- 'sql/snsql/**'
- 'sql/pyproject.toml'
- '!sql/tests/setup/postgres/**'
- '!sql/tests/setup/sqlserver/**'
- '!sql/tests/setup/biqquery/**'
workflow_dispatch:
jobs:
container-job:
runs-on: ubuntu-latest
environment: CI
strategy:
fail-fast: false
matrix:
python-version: [3.9]
max-parallel: 5
steps:
- uses: actions/checkout@v2
- name: start mysql
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
run: |
sudo systemctl start mysql.service
- name: Set up miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
auto-activate-base: true
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
shell: bash -l {0}
run: |
conda install pip
conda update pip
- name: Set MySQL Root password
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
run: |
sudo mysql --user=root --password=root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${{env.MYSQL_PASSWORD}}';"
sudo mysql --user=root --password=${{env.MYSQL_PASSWORD}} -e "CREATE USER 'runner'@'localhost' IDENTIFIED WITH mysql_native_password BY '${{env.MYSQL_PASSWORD}}';"
sudo mysql --user=root --password=${{env.MYSQL_PASSWORD}} -e "GRANT ALL ON *.* TO 'runner'@'localhost'; FLUSH PRIVILEGES;"
sudo mysql --user=root --password=${{env.MYSQL_PASSWORD}} -e "SHOW VARIABLES LIKE 'secure_file_priv';"
- name: Setup SDK
shell: bash -l {0}
run: |
cd sql
pip install --no-cache-dir -r tests/requirements.txt
pip install --no-cache-dir -r tests/setup/mysql/requirements.txt
pip install --no-cache-dir .
- name: Check database connections test fixture
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_USER: runner
run: |
cd sql
mkdir ~/.smartnoise
cp tests/setup/mysql/connections-unit.yaml ~/.smartnoise
python tests/check_databases.py
- name: Copy CSV files
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
run: |
cd sql/tests/setup/mysql
sudo python copy.py
- name: Install Tables to MySQL
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
run: |
cd sql/tests/setup/mysql
mysql --user=runner --password=${{ secrets.MYSQL_PASSWORD }} < create_tables.sql
- name: Check DB install
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_USER: runner
run: |
cd sql
mysql --user=${{env.MYSQL_USER}} --password=${{ env.MYSQL_PASSWORD }} -e 'USE PUMS_large; SELECT COUNT(*) FROM pums_large;'
mysql --user=${{env.MYSQL_USER}} --password=${{ env.MYSQL_PASSWORD }} -e 'USE PUMS; SELECT COUNT(*) FROM pums;'
mysql --user=${{env.MYSQL_USER}} --password=${{ env.MYSQL_PASSWORD }} -e 'USE PUMS_dup; SELECT COUNT(*) FROM pums;'
mysql --user=${{env.MYSQL_USER}} --password=${{ env.MYSQL_PASSWORD }} -e 'USE PUMS_null; SELECT COUNT(*) FROM pums;'
mysql --user=${{env.MYSQL_USER}} --password=${{ env.MYSQL_PASSWORD }} -e 'USE PUMS_pid; SELECT COUNT(*) FROM pums;'
python tests/check_databases.py
- name: Test SDK
shell: bash -l {0}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
run: |
cd sql
export SKIP_PANDAS=1
pytest tests