Commit
·
f439b5f
1
Parent(s):
455e363
COCDのymlファイルの追加
Browse files- .github/workflows/ci.yml +43 -0
.github/workflows/ci.yml
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CI/CD
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [ main ]
|
| 6 |
+
pull_request:
|
| 7 |
+
branches: [ main ]
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
test:
|
| 11 |
+
runs-on: ubuntu-latest
|
| 12 |
+
steps:
|
| 13 |
+
- name: Checkout code
|
| 14 |
+
uses: actions/checkout@v4
|
| 15 |
+
|
| 16 |
+
- name: Set up Python 3.12
|
| 17 |
+
uses: actions/setup-python@v5
|
| 18 |
+
with:
|
| 19 |
+
python-version: '3.12'
|
| 20 |
+
|
| 21 |
+
- name: Cache dependencies
|
| 22 |
+
uses: actions/cache@v4
|
| 23 |
+
with:
|
| 24 |
+
path: ~/.cache/pip
|
| 25 |
+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
| 26 |
+
restore-keys: |
|
| 27 |
+
${{ runner.os }}-pip-
|
| 28 |
+
|
| 29 |
+
- name: Install dependencies
|
| 30 |
+
run: |
|
| 31 |
+
python -m pip install --upgrade pip
|
| 32 |
+
pip install -r requirements.txt
|
| 33 |
+
|
| 34 |
+
- name: Lint and format check with Ruff
|
| 35 |
+
run: |
|
| 36 |
+
ruff check .
|
| 37 |
+
ruff format --check .
|
| 38 |
+
|
| 39 |
+
- name: Type check with Mypy
|
| 40 |
+
run: mypy src/ai_api tests
|
| 41 |
+
|
| 42 |
+
- name: Test with pytest
|
| 43 |
+
run: pytest
|