chore: .gitignore — local tool dizinleri ve artifact'ları ekle #48
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: Tests & Quality | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| # Auto-format only on push to main (trusted); PRs get --check instead | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - run: pip install black | |
| - name: Check formatting (PR) | |
| if: github.event_name == 'pull_request' | |
| run: black --check . | |
| - name: Auto-format and push (main) | |
| if: github.event_name == 'push' | |
| run: | | |
| black . | |
| git diff --exit-code || ( | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add app/ scripts/ tests/ | |
| git commit -m "style: auto-format with black" | |
| git push | |
| ) | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: format | |
| env: | |
| ALLOW_INSECURE_DEFAULTS: "true" | |
| SECRET_KEY: "ci-test-secret-key-that-is-at-least-32-chars" | |
| ADMIN_USERNAME: "testadmin" | |
| ADMIN_PASSWORD: "testpassword" | |
| DATABASE_URL: "sqlite:///./test.db" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements-dev.txt | |
| - name: Lint (pylint) | |
| run: pylint app/ --disable=C0114,C0115,C0116,R0903,W0611 --fail-under=7.0 | |
| - name: Type check (mypy) | |
| run: mypy app/ --ignore-missing-imports --no-strict-optional | |
| - name: Security scan (bandit) | |
| run: bandit -r app/ -ll -q | |
| - name: Run tests (excluding integration) | |
| run: pytest -m "not integration" --cov=app --cov-report=xml -q | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage.xml | |
| continue-on-error: true |