Skip to content

Commit

Permalink
build: Fix dependency setup with dedicated cache step instead of rely…
Browse files Browse the repository at this point in the history
…ing on setup-python's caching
  • Loading branch information
empicano committed Jun 26, 2023
1 parent 8bf774b commit 2409d79
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ 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
id: 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
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version:
# Add "pypy-3.8", "pypy-3.9" again at some point
["3.7", "3.8", "3.9", "3.10", "3.11"]
["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8", "pypy-3.9"]
include:
- os: macos-latest
python-version: "3.7"
Expand All @@ -29,19 +28,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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 poetry
uses: snok/[email protected] # Pinned newest version to make PyPy work
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- 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 2409d79

Please sign in to comment.