12
12
matrix :
13
13
python-version : ["3.10"]
14
14
steps :
15
- - uses : actions/checkout@v1
15
+ - uses : actions/checkout@v3
16
16
- name : Filter changed file paths to outputs
17
17
18
18
id : changes
@@ -33,49 +33,21 @@ jobs:
33
33
if : steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
34
34
run : echo "PUBLISH=$(echo true)" >> $GITHUB_ENV
35
35
36
- - name : Set up Python ${{ matrix.python-version }}
37
- uses : actions/setup-python@v1
38
- with :
39
- python-version : ${{ matrix.python-version }}
40
-
41
- - name : Get full Python version
42
- id : full-python-version
43
- shell : bash
44
- run : echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
45
-
46
36
- name : Install poetry
47
37
run : |
48
38
curl -O -sSL https://install.python-poetry.org/install-poetry.py
49
39
python install-poetry.py -y --version 1.1.12
50
40
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
51
41
rm install-poetry.py
52
42
53
- - name : Add ~/.local/bin to PATH
54
- run : echo "$HOME/.local/bin" >> $GITHUB_PATH
55
-
56
- - name : Get poetry cache paths from config
57
- run : |
58
- echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
59
- echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
60
-
61
- - name : Configure poetry
62
- shell : bash
63
- run : poetry config virtualenvs.in-project true
64
-
65
- - name : Set up cache
66
- uses : actions/cache@v2
67
- id : cache
43
+ - name : Set up Python ${{ matrix.python-version }}
44
+ uses : actions/setup-python@v3
68
45
with :
69
- path : |
70
- .venv
71
- {{ env.poetry_cache_dir }}
72
- {{ env.poetry_virtualenvs_path }}
73
- key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
46
+ python-version : ${{ matrix.python-version }}
47
+ cache : ' poetry'
74
48
75
- - name : Ensure cache is healthy
76
- if : steps.cache.outputs.cache-hit == 'true'
77
- shell : bash
78
- run : poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
49
+ - name : Add ~/.local/bin to PATH
50
+ run : echo "$HOME/.local/bin" >> $GITHUB_PATH
79
51
80
52
- name : Install dependencies [w/ docs]
81
53
run : poetry install --extras "docs lint"
0 commit comments