Skip to content

Commit

Permalink
Another using just actions/setup-python and actions/cache
Browse files Browse the repository at this point in the history
Based on the solution presented in the following issue
actions/setup-python#826 (comment)
  • Loading branch information
jaharkes committed Jul 26, 2024
1 parent e5a6cab commit 8aae1b3
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Run pre-commit checks
Expand All @@ -36,20 +36,19 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup local environment for caching
- name: Install Poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Define cache for virtual environments
pipx install poetry
echo "POETRY_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
- name: Cache poetry
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-${{ matrix.python-version }}
- name: Install project dependencies
run: poetry install --no-interaction
- name: Run tests
Expand Down

0 comments on commit 8aae1b3

Please sign in to comment.