Skip to content

Commit 97e44a9

Browse files
committed
Migrate off of set-output, which is deprecated
This change eliminates warnings in CI caused by the deprecation. In addition, using the `python-version` output of the `setup-python` action fixes a bug that prevented Windows caches from containing the Python version. For reference, Windows caches were created with names that lacked the Python version, like: ``` venv-pull_request-Windows--{hash} ```
1 parent 057e397 commit 97e44a9

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.github/workflows/build-docs.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ jobs:
1212
- uses: actions/checkout@v4
1313

1414
- name: Set up Python 3.12
15+
id: setup-python
1516
uses: actions/setup-python@v5
1617
with:
1718
python-version: 3.12
1819

19-
- name: Get full Python version
20-
id: full-python-version
21-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
22-
2320
- name: Set up poetry
2421
uses: Gr1N/setup-poetry@v9
2522

@@ -31,7 +28,7 @@ jobs:
3128
id: cache
3229
with:
3330
path: .venv
34-
key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
31+
key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
3532

3633
- name: Ensure cache is healthy
3734
if: steps.cache.outputs.cache-hit == 'true'

.github/workflows/python-test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ jobs:
2121
- uses: actions/checkout@v4
2222

2323
- name: Set up Python ${{ matrix.python-version }}
24+
id: setup-python
2425
uses: actions/setup-python@v5
2526
with:
2627
python-version: ${{ matrix.python-version }}
2728

28-
- name: Get full Python version
29-
id: full-python-version
30-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
31-
3229
- name: Set up poetry
3330
uses: Gr1N/setup-poetry@v9
3431

@@ -40,7 +37,7 @@ jobs:
4037
id: cache
4138
with:
4239
path: .venv
43-
key: venv-${{ github.event_name }}-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
40+
key: venv-${{ github.event_name }}-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
4441

4542
- name: Ensure cache is healthy
4643
if: steps.cache.outputs.cache-hit == 'true'

0 commit comments

Comments
 (0)