Skip to content

Commit

Permalink
build: Fix dependency setup by using dedicated cache step instead of …
Browse files Browse the repository at this point in the history
…relying on setup-python's caching
  • Loading branch information
empicano committed Jun 26, 2023
1 parent 8bf774b commit 8d12716
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,21 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Poetry
- name: Set up Python
uses: actions/setup-python@v4 # Uses the Python version in .python-version
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set up Python
uses: actions/setup-python@v4 # Uses the Python version in .python-version
- name: Load virtual environment cache
uses: actions/cache@v2
with:
cache: "poetry"
path: .venv
key: ${{ runner.os }}-${{ hashFiles("poetry.lock") }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: scripts/setup
- name: Build documentation
run: scripts/docs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch entire history for poetry-dynamic-versioning, see: https://github.com/mtkennerly/poetry-dynamic-versioning/issues/55
- name: Install Poetry
- name: Set up Python
uses: actions/setup-python@v4 # Uses the Python version in .python-version
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set up Python
uses: actions/setup-python@v4 # Uses the Python version in .python-version
- name: Setup dynamic versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build package
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/[email protected] # Pinned newest version to make Windows work
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- run: poetry config virtualenvs.prefer-active-python true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: rm poetry.lock && scripts/setup ${{ matrix.python-version }} # Ignore poetry.lock
run: rm poetry.lock && scripts/setup # Ignore poetry.lock
- name: Run checks
run: scripts/check --dry
- name: Test with pytest
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ set -o errexit -o pipefail -o nounset
# Change into the project's directory
cd "$(dirname "$0")/.."

python_version=$1

# Install the dependencies
#poetry env use "python$python_version"
poetry install --with dev --sync

0 comments on commit 8d12716

Please sign in to comment.