offchain icon indicating copy to clipboard operation
offchain copied to clipboard

Cache poetry deps in Github Actions in order to speed up builds

Open atapin opened this issue 1 year ago • 2 comments

This can be done by modifying setup python step:

- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: '3.9'
    cache: poetry
    cache-dependency-path: poetry.lock

atapin avatar Jul 04 '24 17:07 atapin

Tested this in https://github.com/atapin/offchain/pull/1 Surprisingly, there's no profit from caching. But there's 25% speed up if style check and testing are ran inside the same job.

@mattlenz @mattmalec do you think it makes sense to put these steps under the same job? It seems to me, there's no much sense to run tests if style-check is failed. Because if style-check failed and tests succeeded, we couldn't just fix style and assume the test would succeed after this fix.

atapin avatar Jul 05 '24 06:07 atapin

Another improvement of CI pipeline, that really should bring benefits to the project is matrix build. For a library, it's important to run builds across different OS's and supported python versions. Let me know if I can help with this.

atapin avatar Jul 05 '24 06:07 atapin