-
Notifications
You must be signed in to change notification settings - Fork 36
76 lines (62 loc) · 1.77 KB
/
install-lint-test-on-ubuntu.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
name: Install Package, Lint Code & Run Tests on Ubuntu
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
install-lint-test-on-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: # github.com/actions/python-versions/releases
- 3.12
# - 3.13
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout Repo
uses: actions/checkout@v4 # github.com/actions/checkout
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 # github.com/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: make get-poetry
- name: Install Package & Dependencies
run: make install
- name: Wait for MySQL to be ready
run: |
until mysqladmin ping -h 127.0.0.1 --silent; do
echo "Waiting for MySQL..."
sleep 5
done
- name: Set up Alembic Configuration
run: |
cp .github/workflows/alembic.ini .
- name: Run Migrations
run: |
python -m alembic upgrade head
env:
DATABASE_URL: mysql+pymysql://[email protected]/test
- name: Lint Code
run: make lint
- name: Run Tests
run: make test
env:
LEPTON_API_KEY: ${{ secrets.LEPTON_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DB_NAME: test