ourzora / offchain

NFT Metadata made easy
MIT License
107 stars 27 forks source link

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

Open atapin opened 1 month ago

atapin commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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.