From 188e187ab25f959a7f353d33bfa29e730581e349 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Fri, 25 Oct 2024 11:58:56 -0400 Subject: [PATCH] fix(python_checks): improve python caching --- .github/workflows/python_checks.yml | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/python_checks.yml b/.github/workflows/python_checks.yml index b56fced..28e05a4 100644 --- a/.github/workflows/python_checks.yml +++ b/.github/workflows/python_checks.yml @@ -24,18 +24,10 @@ jobs: id: setup_python with: python-version: ${{ inputs.python_version }} - - name: venv cache - uses: actions/cache@v4 - with: - key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} - path: venv + cache: "pip" + cache-dependency-path: requirements.txt - name: install dependencies - run: | - python -m venv venv - source venv/bin/activate - python -m pip install -r requirements.txt - echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH - echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV + run: pip install -r requirements.txt - name: run pyright uses: jakebailey/pyright-action@v2 with: @@ -64,18 +56,10 @@ jobs: id: setup_python with: python-version: ${{ inputs.python_version }} - - name: venv cache - uses: actions/cache@v4 - with: - key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} - path: venv + cache: "pip" + cache-dependency-path: requirements.txt - name: install dependencies - run: | - python -m venv venv - source venv/bin/activate - python -m pip install -r requirements.txt - echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH - echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV + run: pip install -r requirements.txt - name: run tests run: pytest --junitxml=junit/test-results-${{ steps.setup_python.outputs.python-version }}.xml - name: upload pytest results