Skip to content

Commit 4cf8956

Browse files
authored
Install dependencies with make install in CI steps (#742)
* Manually cache venv, since we're working outside of what setup-python expects with using `poetry`
1 parent f8b1c0b commit 4cf8956

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,35 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
10-
- name: Install poetry
11-
run: pipx install poetry
1210
- uses: actions/setup-python@v4
11+
id: setup-python
1312
with:
1413
python-version: "3.11"
15-
cache: "poetry"
14+
- name: Install poetry
15+
run: pipx install poetry
16+
- uses: actions/cache@v3
17+
with:
18+
path: .venv
19+
key: poetry-${{ steps.setup-python.outputs.python-version}}-${{ hashFiles('poetry.lock') }}
1620
- name: Install dependencies
17-
run: poetry install
21+
run: make install
1822
- run: bin/lint.sh
1923
run_test:
2024
runs-on: ubuntu-latest
2125
steps:
2226
- uses: actions/checkout@v3
23-
- name: Install poetry
24-
run: pipx install poetry
2527
- uses: actions/setup-python@v4
28+
id: setup-python
2629
with:
2730
python-version: "3.11"
28-
cache: "poetry"
31+
- name: Install poetry
32+
run: pipx install poetry
33+
- uses: actions/cache@v3
34+
with:
35+
path: .venv
36+
key: poetry-${{ steps.setup-python.outputs.python-version}}-${{ hashFiles('poetry.lock') }}
2937
- name: Install dependencies
30-
run: poetry install
38+
run: make install
3139
- name: Run tests
3240
run: bin/test.sh
3341
review-dependabot-pr:

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ clean:
3333
find . -name "__pycache__" | xargs rm -rf
3434
rm -rf .mypy_cache .pytest_cache .coverage .venv
3535

36+
$(VENV)/bin/python:
37+
python3 -m venv $(VENV)
3638

37-
install: $(INSTALL_STAMP)
39+
install: $(VENV)/bin/python $(INSTALL_STAMP)
3840
$(INSTALL_STAMP): poetry.lock
3941
@if [ -z $(shell command -v poetry 2> /dev/null) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
4042
POETRY_VIRTUALENVS_IN_PROJECT=1 poetry install --with dev --no-root

0 commit comments

Comments
 (0)