Sweep: Replace the UV install section in the Dockerfiles with the following (✓ Sandbox Passed) #21
Workflow file for this run
This file contains 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: Python CI All | |
on: | |
pull_request: | |
branches: | |
- main | |
- dev | |
# paths: | |
# - 'sweepai/**' | |
# - 'tests/**' | |
push: | |
branches: | |
- main | |
- dev | |
paths: | |
- 'sweepai/**' | |
- 'tests/**' | |
jobs: | |
python-ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
# python-version: ["3.10", "3.11"] | |
os: [ubuntu-latest] | |
outputs: | |
cache-key: ${{ steps.cache-dependencies.outputs.cache-key }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.67.0 | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore dependencies | |
id: restore-dependencies | |
uses: actions/cache/restore@v4 | |
with: | |
path: "~" | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-python-${{ matrix.python-version }}- | |
${{ runner.os }}-python- | |
- run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV | |
if: steps.restore-dependencies.outputs.cache-hit != 'true' | |
- run: pip install uv | |
if: steps.restore-dependencies.outputs.cache-hit != 'true' | |
- run: uv pip install -r requirements.txt | |
if: steps.restore-dependencies.outputs.cache-hit != 'true' | |
- run: uv pip install ruff pylint pytest pytest-xdist black | |
if: steps.restore-dependencies.outputs.cache-hit != 'true' | |
- name: Cache dependencies | |
id: cache-dependencies | |
uses: actions/cache/save@v4 | |
with: | |
path: "~" | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }} | |
- name: Format with Black | |
run: black sweepai | |
- name: Lint with Ruff | |
run: ruff check sweepai | |
- name: Lint with Pylint | |
run: pylint sweepai --errors-only | |
- name: Run Unit Tests | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: python -m unittest sweepai/**/*_test.py | |
- name: Set up Redis (for e2e tests) | |
run: | | |
sudo apt-get update | |
sudo apt-get install redis-server | |
sudo lsof -i :6379 || true | |
- name: Run e2e Tests | |
env: | |
GITHUB_PAT: ${{ secrets.GH_PAT }} | |
GITHUB_APP_ID: ${{ secrets.GH_APP_ID }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
GITHUB_APP_PEM: ${{ secrets.GH_APP_PEM }} | |
OPENAI_API_TYPE: azure | |
OPENAI_API_BASE: ${{ secrets.GH_OPENAI_API_BASE }} | |
OPENAI_API_VERSION: 2024-02-15-preview | |
AZURE_API_KEY: ${{ secrets.GH_AZURE_API_KEY }} | |
AZURE_OPENAI_DEPLOYMENT: ${{ secrets.GH_AZURE_OPENAI_DEPLOYMENT }} | |
run: PYTHONPATH=. pytest -n 4 tests/e2e -s | |
timeout-minutes: 30 |