I need to run poetry version to get the pyproject.toml version on every push to master touching pyproject.toml. However, since Poetry is not installed on GitHub Actions runner virtual environments, I also need to install it before I can run any Poetry commands. I want to cache this tool installation so I don't have to install it on every run and use up Actions minutes. The only Poetry command I need to run is poetry version, so I'm not worried about the tool being outdated - it only needs to parse the pyproject.toml and get the project version number. I'm also not sure what to use as my key for the caching action - I assume it can be static
The desired order of operations would be something like:
- Check out repo.
- Check cache for Poetry. If it's not installed, install it.
- Run
poetry version.