Skip to content

Commit 95b4b2a

Browse files
committed
github: Add test for setup-poetry caching
1 parent fd4f5f0 commit 95b4b2a

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/test_actions.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,40 @@ jobs:
5555
fi
5656
shell: bash
5757

58+
test_setup_poetry_caching:
59+
name: Test setup-poetry caching
60+
runs-on: ${{ matrix.os }}
61+
needs: test_setup_poetry
62+
strategy:
63+
matrix:
64+
os: [windows-latest, ubuntu-latest]
65+
python-version: [3.9, '3.10', 3.11, 3.12, 3.13]
66+
steps:
67+
- name: Check out repo
68+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69+
- name: Set up Python
70+
uses: ./setup-python
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
- name: Set up Poetry
74+
id: setup-poetry
75+
uses: ./setup-poetry
76+
- name: Check that Poetry was loaded from the cache
77+
if: steps.setup-poetry.outputs.cache-hit != 'true'
78+
run: |
79+
echo "::error title=Test Failure::The cache was not hit."
80+
exit 1
81+
shell: bash
82+
- name: Create project
83+
run: poetry new test-project
84+
- name: Check that the project was created
85+
run: |
86+
if [ ! -f test-project/pyproject.toml ]; then
87+
echo "::error title=Test Failure::The project file does not exist."
88+
exit 1
89+
fi
90+
shell: bash
91+
5892
test_check_project_version:
5993
name: Test check-project-version
6094
runs-on: ubuntu-latest
@@ -143,7 +177,7 @@ jobs:
143177
test_results:
144178
name: Test Results
145179
runs-on: ubuntu-latest
146-
needs: [test_setup_python, test_setup_poetry, test_check_project_version, test_update_project_version]
180+
needs: [test_setup_python, test_setup_poetry, test_setup_poetry_caching, test_check_project_version, test_update_project_version]
147181
if: ${{ !cancelled() }}
148182
steps:
149183
- run: exit 0

0 commit comments

Comments
 (0)