Skip to content

Commit f7b9c33

Browse files
authored
Update ci.yml
1 parent 1d26534 commit f7b9c33

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/ci.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: "*"
76

87
jobs:
98
static-analysis: # mypy, black, ruff 등 정적 분석만 실행
@@ -60,6 +59,13 @@ jobs:
6059
test: # mypy와 직렬로 실행하게되면 시간이 너무 오래 걸려서 test와 정적 타입분석은 병렬로 실행
6160
runs-on: ubuntu-22.04
6261

62+
env:
63+
MYSQL_HOST: 127.0.0.1
64+
MYSQL_PORT: 3306
65+
MYSQL_USER: root
66+
MYSQL_PASSWORD: 1234
67+
MYSQL_DATABASE: when2meet
68+
6369
steps:
6470
- name: Check out the codes
6571
uses: actions/checkout@v2
@@ -96,6 +102,17 @@ jobs:
96102
if: steps.cache-venv.outputs.cache-hit != 'true'
97103
run: poetry install --no-root
98104

105+
- name: Set timezone to KST
106+
run: |
107+
sudo rm /etc/localtime
108+
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
109+
110+
- name: Start MySQL
111+
run: |
112+
sudo systemctl start mysql
113+
mysql -e "use mysql; FLUSH PRIVILEGES; ALTER USER '${{ env.MYSQL_USER }}'@'localhost' IDENTIFIED BY '${{ env.MYSQL_PASSWORD }}';" -uroot -proot
114+
mysql -e 'CREATE DATABASE ${{ env.MYSQL_DATABASE }};' -u${{ env.MYSQL_USER }} -p${{ env.MYSQL_PASSWORD }}
115+
99116
- name: Run tests # 커버리지로 pytest를 실행하고 결과 report를 출력한다.
100117
run: |
101118
poetry run coverage run -m pytest .

0 commit comments

Comments
 (0)