Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9acef0b

Browse files
committed
ci(tests): Use poetry cache action
1 parent 623a393 commit 9acef0b

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ jobs:
99
matrix:
1010
python-version: [ '3.10' ]
1111
steps:
12-
- uses: actions/checkout@v1
12+
- uses: actions/checkout@v3
1313
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v1
14+
uses: actions/setup-python@v3
1515
with:
1616
python-version: ${{ matrix.python-version }}
1717

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-
2318
- name: Install poetry
2419
run: |
2520
curl -O -sSL https://install.python-poetry.org/install-poetry.py
@@ -30,30 +25,6 @@ jobs:
3025
- name: Add ~/.local/bin to PATH
3126
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
3227

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
45-
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') }}
51-
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
56-
5728
- name: Install dependencies
5829
run: poetry install -E "docs test coverage lint format"
5930

0 commit comments

Comments
 (0)