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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
please document how the cache should be configured using this action #64
Comments
I use caching in my project with following setting: In definition of the github action job: - uses: actions/cache@v3
name: Cache .venv
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }} Add poetry.toml file in root of project with following settings: [virtualenvs]
create = true
in-project = true How does it work:
Using this, when dependencies do not change in build, I do not have to download and install it again, but I can skip this step and do testing. |
馃檹 thank you very much for your comprehensive explanation 馃槂 Just to make sure I got it right, can you confirm that the steps would be in the following order, please? name: Python package
# ...
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.5.1
- uses: actions/cache@v3
name: Cache .venv
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install project dependencies
run: poetry install
- name: Run automated tests
run: poetry run pytest -v Is that ok? [edit2: hi @abatilo; would you be interested in a pull-request adding a section in the README file to document how to combine actions-poetry with actions/cache for faster |
I am neither owner nor contributer to this repo. It is more up to @abatilo what should or should not be in his project readme :) |
Forgive me for the confusion 馃憤 Beside that, does the workflow proposed in #64 (comment) seem ok to you? |
Sorry for the delay here. I was traveling for work. I think it makes sense that the original workflow steps would fail. You are trying to reference the poetry cash in this step that installs Python but poetry hasn't actually been installed yet. So there's a chicken and egg problem. Installing Python and then installing poetry and then doing the cache steps make sense to me. I would definitely be open to a pull request that adds the guidance to the readme. Thank you both |
It looks good. |
馃帀 This issue has been resolved in version 2.4.0 馃帀 The release is available on GitHub release Your semantic-release bot 馃摝馃殌 |
thank you @abatilo for this github action 馃檹
Before using your action, I:
I tried using the actions-poetry action like this:
The
cache 'poetry'
line in the actions/setup-python@v4 action causes the job to fail:Can you please tell me (and add in the README file) how one should set up a cache for poetry to speed up the download of dependencies? 馃檹
The text was updated successfully, but these errors were encountered: