Skip to content

Commit

Permalink
fix(python_checks): improve python caching (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored Oct 25, 2024
2 parents 0b50e5b + 188e187 commit a30e7b9
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/python_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a30e7b9

Please sign in to comment.