-
Notifications
You must be signed in to change notification settings - Fork 20
81 lines (66 loc) · 1.79 KB
/
integration-mysql-ci.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
name: MySQL Integration CI
on:
pull_request:
paths:
- "grai-integrations/source-mysql/**"
- "grai-client/**"
- "grai-server/**"
concurrency:
group: ${{ github.ref }}-mysql-ci
cancel-in-progress: true
env:
py_ver: "3.10"
poetry_ver: "1.2.2"
project_dir: "grai-integrations/source-mysql"
DB_DATABASE: grai
DB_USER: grai
DB_PASSWORD: grai
DB_HOST: localhost
jobs:
lint-integration-mysql:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "${{ env.py_ver }}"
- run: pip install black isort
- run: |
black . --check
isort . --profile black --check
tests-integration-mysql:
needs: lint-integration-mysql
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
services:
test_db:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
MYSQL_USER: ${{ env.DB_USER }}
MYSQL_PASSWORD: ${{ env.DB_PASSWORD }}
MYSQL_DATABASE: ${{ env.DB_DATABASE }}
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Set up MySQL
working-directory: ${{ env.project_dir }}/data/scripts
run: |
sh init-db.sh
- uses: actions/setup-python@v4
with:
python-version: "${{ env.py_ver }}"
- run: |
pip install pytest
pip install .
- run: pytest