Merge pull request #16 from HardMax71/dev #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ruff | |
| on: | |
| push: | |
| branches: [ main, v2 ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| # API keys from repository secrets (in case ruff somehow imports settings) | |
| TEXT_LLM_API_KEY: ${{ secrets.TEXT_LLM_API_KEY }} | |
| OCR_LLM_API_KEY: ${{ secrets.OCR_LLM_API_KEY }} | |
| GITHUB_ACTIONS: true | |
| jobs: | |
| lint: | |
| 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: Install ruff | |
| run: | | |
| uv pip install --system ruff | |
| - name: Run Ruff format check | |
| run: | | |
| cd backend | |
| ruff format --check --config pyproject.toml . | |
| - name: Run Ruff linting | |
| run: | | |
| cd backend | |
| ruff check --config pyproject.toml . |