Skip to content

Commit

Permalink
Updated GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlu1248 committed Mar 14, 2024
1 parent d019cb4 commit 22616aa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,27 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
- run: pip install uv
- run: uv pip install -r requirements.txt
- run: uv pip install black ruff pylint uvicorn pytest
- name: Restore dependencies
id: restore-dependencies
uses: actions/cache/restore@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-
${{ runner.os }}-python-
- name: Install Python dependencies
if: steps.restore-dependencies.outputs.cache-hit != 'true'
run: |
pip install uv
uv pip install -r requirements.txt
uv pip install black ruff pylint uvicorn pytest
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache/save@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}

code-quality:
needs: setup-and-dependencies
Expand All @@ -52,6 +69,13 @@ jobs:
with:
python-version: 3.11

- uses: actions/cache@v4
name: Fetch dependencies
id: fetch-dependencies
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}

- run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
- name: Lint with Ruff
run: ruff check sweepai
Expand All @@ -71,6 +95,13 @@ jobs:
with:
python-version: 3.11 # Choose based on your project's needs

- uses: actions/cache@v4
name: Fetch dependencies
id: fetch-dependencies
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}

- name: Run Unit Tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -88,6 +119,13 @@ jobs:
with:
python-version: 3.11 # Choose based on your project's needs

- uses: actions/cache@v4
name: Fetch dependencies
id: fetch-dependencies
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}

- name: Set up Redis (for e2e tests)
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Homepage = "https://sweep.dev"

[project]
name = "sweepai"
version = "1.0.13"
version = "1.1.0"
description = "Sweep fixes GitHub issues"
authors = [
{name = "Kevin Lu", email = "[email protected]"},
Expand Down

0 comments on commit 22616aa

Please sign in to comment.