-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (74 loc) · 2.62 KB
/
Copy pathpython-lint.yml
File metadata and controls
91 lines (74 loc) · 2.62 KB
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
name: Python Lint CI
# トリガー条件: pushされたとき、またはpython-audio-analyzerディレクトリが変更されたとき
on:
push:
paths:
- 'apps/python-audio-analyzer/**'
- '.github/workflows/python-lint.yml'
pull_request:
paths:
- 'apps/python-audio-analyzer/**'
- '.github/workflows/python-lint.yml'
jobs:
lint-and-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/python-audio-analyzer
steps:
# 1. リポジトリをチェックアウト
- name: Checkout
uses: actions/checkout@v6
# 2. Python をセットアップ
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
# 3. Python依存関係のキャッシュ
- name: Cache Python dependencies
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
# 4. 依存パッケージのインストール
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
# 5. Ruff Lint チェック
- name: Run Ruff Lint
run: python -m ruff check .
# 6. Ruff Format チェック
- name: Run Ruff Format Check
run: python -m ruff format . --check
# 7. MyPy 型チェック (オプション)
- name: Run MyPy Type Check
run: python -m mypy .
continue-on-error: true # 型チェックエラーがあってもワークフローを継続
# 8. テスト実行 (将来的にテストが追加された場合)
- name: Run Tests
run: python -m pytest
continue-on-error: true # テストがない場合でも継続
# 9. Python OpenAPI Spec が最新であることを検証
- name: Verify Python OpenAPI spec
run: |
python scripts/export_openapi.py
git diff --exit-code -- ../../packages/shared-types/openapi/audio-analyzer.json
build-docker:
runs-on: ubuntu-latest
needs: lint-and-test
defaults:
run:
working-directory: apps/python-audio-analyzer
steps:
# 1. リポジトリをチェックアウト
- name: Checkout
uses: actions/checkout@v6
# 2. Docker Buildx セットアップ
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
# 3. Docker イメージビルド
- name: Build Docker image
run: docker build -t sonory-audio-analyzer .