fix(jobspy): roda scrape em subprocesso real para restaurar a busca d… #5
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - 'feature/*' | |
| - 'fix/*' | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| run: pip install poetry | |
| - name: Install dependencies | |
| run: poetry install --with dev | |
| - name: Run ruff check | |
| run: poetry run ruff check . | |
| - name: Run ruff format check | |
| run: poetry run ruff format --check . | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_DB: iterbot_test | |
| POSTGRES_USER: iterbot_user | |
| POSTGRES_PASSWORD: test_password | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| run: pip install poetry | |
| - name: Install dependencies | |
| run: poetry install --with dev | |
| - name: Run pytest with coverage | |
| env: | |
| DATABASE_URL: postgresql://iterbot_user:test_password@localhost:5432/iterbot_test | |
| REDIS_URL: redis://localhost:6379/0 | |
| run: | | |
| poetry run pytest --cov -v | |
| - name: Upload coverage HTML | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-html | |
| path: htmlcov/ | |
| retention-days: 7 | |
| - name: Upload coverage XML | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-xml | |
| path: coverage.xml | |
| retention-days: 7 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| continue-on-error: true | |
| - name: Add Coverage Comment to PR | |
| uses: romeovs/lcov-reporter-action@v0.3.1 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| lcov-file: ./coverage.lcov | |
| delete-old-comments: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| continue-on-error: true | |
| security: | |
| name: Security | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| run: pip install poetry poetry-plugin-export | |
| - name: Install dependencies | |
| run: poetry install --only main | |
| - name: Export requirements for pip-audit | |
| run: poetry export --only main -f requirements.txt -o requirements-audit.txt --without-hashes | |
| - name: Run pip-audit | |
| uses: pypa/gh-action-pip-audit@v1.1.0 | |
| with: | |
| inputs: requirements-audit.txt | |
| ignore-vulns: >- | |
| CVE-2025-65431 | |
| CVE-2025-65430 | |
| CVE-2026-27982 | |
| CVE-2026-32597 | |
| CVE-2025-46656 | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| scan-type: 'fs' | |
| scan-ref: '.' | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| severity: 'CRITICAL,HIGH,MEDIUM,LOW' | |
| continue-on-error: true | |
| - name: Upload Trivy results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v2 | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |
| continue-on-error: true |