From 22616aaa66c08895e175c9f495858b2cf62254f0 Mon Sep 17 00:00:00 2001 From: Kevin Lu Date: Wed, 13 Mar 2024 17:49:39 -0700 Subject: [PATCH] Updated GHA --- .github/workflows/python.yml | 46 ++++++++++++++++++++++++++++++++---- pyproject.toml | 2 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index bed36cc142..220ca97269 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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 @@ -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 @@ -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 }} @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 55c1ef83c7..ae67b91212 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "kevin@sweep.dev"},