Skip to content

Commit 3e59af0

Browse files
ci: snok/install-poetry@v1 (#54)
* ci: Cache Removal of poetry cache in Python setup * ci: PATH Inclusion of poetry in PATH for Windows runners * fix: Indentation * ci: $VENV * ci: Operation sequence * ci: Manual PATH * fix: Redundant command * ci: Default shell * ci: Windows PATH Removed step to add poetry to PATH on Windows. * ci: Cache * ci: venv cache * ci: poetry cache * ci: Cache configuration OS-agnostic cache path * ci: Cache key Python version added to cache key * ci: Cache path for cross-platform support * ci: Cache path * ci: Windows cache path * ci: Window path format * ci: Windows cache path format * ci: $PATH * ci: Poetry PATH configuration for Windows * ci: Poetry PATH * ci: bash for poetry PATH on Windows * Initial plan * Fix venv cache path for Windows support Co-authored-by: lahovniktadej <57890734+lahovniktadej@users.noreply.github.com> * ci: Virtual environment Removal of caching for virtual environment --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 2d88580 commit 3e59af0

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,40 @@ jobs:
2222
os: [ubuntu-latest, windows-latest, macos-latest]
2323
python-version: ['3.10', '3.11', '3.12', '3.13']
2424
runs-on: ${{ matrix.os }}
25-
25+
defaults:
26+
run:
27+
shell: bash
2628
steps:
2729
- uses: actions/checkout@v4
28-
2930
- name: Set up Python ${{ matrix.python-version }}
3031
id: setup-python
3132
uses: actions/setup-python@v5
3233
with:
3334
python-version: ${{ matrix.python-version }}
34-
cache: poetry
35-
35+
- name: Load cached Poetry installation
36+
id: cached-poetry
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ runner.os == 'Windows' && 'C:\Users\runneradmin\.local' || runner.os == 'macOS' && '/Users/runner/.local' || '/home/runner/.local' }}
40+
key: poetry-${{ matrix.python-version }}-${{ runner.os }}
3641
- name: Install Poetry
42+
if: steps.cached-poetry.outputs.cache-hit != 'true'
3743
uses: snok/install-poetry@v1
3844
with:
3945
version: 1.8.3
4046
virtualenvs-create: true
4147
virtualenvs-in-project: true
4248
installer-parallel: true
43-
44-
- name: Check Poetry
49+
- name: Add Poetry to PATH for bash (Windows)
50+
if: runner.os == 'Windows'
51+
shell: bash
52+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
53+
- name: Configure poetry
54+
if: steps.cached-poetry.outputs.cache-hit == 'true'
55+
run: poetry config virtualenvs.in-project true
56+
- name: Check Poetry version
4557
run: poetry --version
46-
4758
- name: Install dependencies
4859
run: poetry install --no-interaction --no-ansi
49-
5060
- name: Run tests
5161
run: poetry run pytest -q

0 commit comments

Comments
 (0)