Skip to content

Commit 780e3df

Browse files
committed
Added poetry virtualenv caching + wrapped tox and coverage with poetry to ensure they run in the poetry venv.
1 parent 3953675 commit 780e3df

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/poetry.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,20 @@ jobs:
4242
uses: Gr1N/setup-poetry@v7
4343
with:
4444
poetry-version: 1.1.8
45+
- uses: actions/cache@v2
46+
with:
47+
path: ~/.cache/pypoetry/virtualenvs
48+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
4549
- name: Install dependencies
4650
run: poetry install
4751
- name: Ensure build successful
4852
run: poetry build
4953
- name: Run tox
50-
run: tox
54+
run: poetry run tox
5155
- name: Generate coverage reports
5256
run: >
53-
coverage report && coverage xml -o ${{ env.REPORTS_DIR }}/coverage.xml &&
54-
coverage html -d ${{ env.REPORTS_DIR }}
57+
poetry run coverage report && coverage xml -o ${{ env.REPORTS_DIR }}/coverage.xml &&
58+
poetry run coverage html -d ${{ env.REPORTS_DIR }}
5559
- name: Artifact reports
5660
if: ${{ ! cancelled() }}
5761
# see https://github.com/actions/upload-artifact

0 commit comments

Comments
 (0)