|
9 | 9 | matrix: |
10 | 10 | python-version: [ '3.10' ] |
11 | 11 | steps: |
12 | | - - uses: actions/checkout@v1 |
13 | | - - name: Set up Python ${{ matrix.python-version }} |
14 | | - uses: actions/setup-python@v1 |
15 | | - with: |
16 | | - python-version: ${{ matrix.python-version }} |
17 | | - |
18 | | - - name: Get full Python version |
19 | | - id: full-python-version |
20 | | - shell: bash |
21 | | - run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") |
22 | | - |
| 12 | + - uses: actions/checkout@v3 |
23 | 13 | - name: Install poetry |
24 | 14 | run: | |
25 | 15 | curl -O -sSL https://install.python-poetry.org/install-poetry.py |
26 | 16 | python install-poetry.py -y --version 1.1.12 |
27 | 17 | echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV |
28 | 18 | rm install-poetry.py |
29 | 19 |
|
30 | | - - name: Add ~/.local/bin to PATH |
31 | | - run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
32 | | - |
33 | | - - name: Get poetry cache paths from config |
34 | | - run: | |
35 | | - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV |
36 | | - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV |
37 | | -
|
38 | | - - name: Configure poetry |
39 | | - shell: bash |
40 | | - run: poetry config virtualenvs.in-project true |
41 | | - |
42 | | - - name: Set up cache |
43 | | - uses: actions/cache@v2 |
44 | | - id: cache |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v3 |
45 | 22 | with: |
46 | | - path: | |
47 | | - .venv |
48 | | - ${{ env.poetry_cache_dir }} |
49 | | - ${{ env.poetry_virtualenvs_path }} |
50 | | - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + cache: 'poetry' |
51 | 25 |
|
52 | | - - name: Ensure cache is healthy |
53 | | - if: steps.cache.outputs.cache-hit == 'true' |
54 | | - shell: bash |
55 | | - run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv |
| 26 | + - name: Add ~/.local/bin to PATH |
| 27 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
56 | 28 |
|
57 | 29 | - name: Install dependencies |
58 | 30 | run: poetry install -E "docs test coverage lint format" |
|
0 commit comments