-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.5 KB
/
mypy.yml
File metadata and controls
59 lines (47 loc) · 1.5 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
name: mypy
on:
push:
branches: [ main, v2 ]
pull_request:
branches: [ main ]
env:
# API keys from repository secrets (needed when mypy imports settings.py)
TEXT_LLM_API_KEY: ${{ secrets.TEXT_LLM_API_KEY }}
OCR_LLM_API_KEY: ${{ secrets.OCR_LLM_API_KEY }}
GITHUB_ACTIONS: true
jobs:
type-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Create .env file from example
run: |
# Copy the example file
cp backend/.env.example backend/.env
# Replace API keys with secrets
sed -i "s|TEXT_LLM_API_KEY=.*|TEXT_LLM_API_KEY=$TEXT_LLM_API_KEY|" backend/.env
sed -i "s|OCR_LLM_API_KEY=.*|OCR_LLM_API_KEY=$OCR_LLM_API_KEY|" backend/.env
echo "✓ Created .env file with API keys from secrets"
- name: Create virtual environment
run: |
cd backend
uv venv
- name: Install dependencies
run: |
cd backend
# Use uv sync to install all dependencies including dev group
uv sync --all-groups
- name: Run mypy on backend
run: |
cd backend
source .venv/bin/activate
mypy . --config-file pyproject.toml