-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CI workflow runs using manually created virtual environments #10601
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,12 +60,25 @@ jobs: | |
poetry-version: ${{ env.POETRY_VERSION }} | ||
|
||
- name: Load Poetry Cached Libraries ⬇ | ||
id: cache-poetry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
path: .venv | ||
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ env.DEFAULT_PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}-${{ secrets.POETRY_CACHE_VERSION }} | ||
restore-keys: ${{ runner.os }}-poetry-${{ env.DEFAULT_PYTHON_VERSION }} | ||
|
||
- name: Clear Poetry cache | ||
if: steps.cache-poetry.outputs.cache-hit == 'true' && contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-docs-tests') | ||
run: rm -r .venv | ||
|
||
- name: Create virtual environment | ||
if: (steps.cache-poetry.outputs.cache-hit != 'true' || contains(github.event.pull_request.labels.*.name, 'tools:clear-poetry-cache-docs-tests')) | ||
run: python -m venv create .venv | ||
|
||
- name: Set up virtual environment | ||
if: needs.changes.outputs.docs == 'true' | ||
run: poetry config virtualenvs.in-project true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it correct to set this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is bypassing the creation of the venv in poetry somehow, because this is what failed before
In the case the |
||
|
||
- name: Load Yarn Cached Packages ⬇ | ||
uses: actions/cache@v2 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Manually create Python virtual environments in CI workflows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we document PR labels like
tools:clear-poetry-cache-docs-tests
somewhere? I haven't created the label yet on github (same for other new labels introduced in this PR)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This notion page is the closest I can find
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I guess I'll just create the labels in GitHub for now, and describe them here