-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Split cache step into two, always save cache, fix hash files #422
Conversation
composite/action.yml
Outdated
uses: actions/cache/save@v3 | ||
if: always() |
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.
with this, you can essentially remove the date trick that accounts for #418 (comment), right?
Test Results (Test Files) 140 files ±0 10 errors 730 suites ±0 2h 12m 25s ⏱️ ±0s For more details on these parsing errors, failures and errors, see this check. Results for commit 3b245f4. ± Comparison against base commit 2c22e15. ♻️ This comment has been updated with latest results. |
uses: actions/cache@v3 | ||
- name: Restore PIP packages cache | ||
id: cache | ||
uses: actions/cache/restore@v3 |
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.
can I use this branch directly?
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.
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.
uses: EnricoMi/publish-unit-test-result-action/composite@branch-composite-cache-pip-packages-2
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 went for the direct hash, so it's clear which commit was used, but now I realize that "Set up job" lists them.
composite/action.yml
Outdated
@@ -238,6 +239,14 @@ runs: | |||
LOG_LEVEL: ${{ inputs.log_level }} | |||
shell: bash | |||
|
|||
- name: Save PIP packages cache | |||
uses: actions/cache/save@v3 | |||
if: always() |
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.
if: success() || failure()
always()
includes cancelled()
which might result in a partial broken cache
https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
A timeout can easily happen on tests, in which case an empty cache might over-write pip cache. Or the timeout happens while the pip is running which results in bad state.
6df3e74
to
f3d26d2
Compare
463c81c
to
8501241
Compare
Please let me know if I should re-run on latest of this PR. Also please see the comments in this PR, they might be hiding between the test results. |
8501241
to
39cb97a
Compare
@TWiStErRob go for it, please test this branch! |
I reran it just to try and it took more than a minute second time: Both times it restored caches. |
Can you rerun the |
Cancelled and running again with latest: https://github.com/TWiStErRob/net.twisterrob.libraries/actions/runs/4416412575/attempts/6 |
Thanks! |
Sorry, cancelled again, hopefully reduced CI time significantly by running less tests. |
8530724
to
1781604
Compare
d5f8056
to
7b55088
Compare
continue-on-error: true | ||
with: | ||
path: ${{ steps.os.outputs.pip-cache }} | ||
key: enricomi-publish-action-${{ runner.os }}-${{ runner.arch }}-pip-${{ steps.python.outputs.version }}-${{ hashFiles('**/requirements.txt', 'composite/action.yml') }} | ||
key: enricomi-publish-action-${{ runner.os }}-${{ runner.arch }}-pip-${{ steps.python.outputs.version }}-f3f2c295046c91ed612b4efb6c9fb352 | ||
|
||
- name: Install Python dependencies |
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.
Can this affect steps.python.outputs.version
, so that when it comes to cache/save
it's a different version but it's still using the old key?
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.
Don't get it. With key: ${{ steps.cache.outputs.cache-primary-key }}
, the same key is used when saving the cache. Why should the python version change?
continue-on-error: true | ||
with: | ||
path: ${{ steps.os.outputs.pip-cache }} | ||
key: enricomi-publish-action-${{ runner.os }}-${{ runner.arch }}-pip-${{ steps.python.outputs.version }}-${{ hashFiles('**/requirements.txt', 'composite/action.yml') }} | ||
key: enricomi-publish-action-${{ runner.os }}-${{ runner.arch }}-pip-${{ steps.python.outputs.version }}-f3f2c295046c91ed612b4efb6c9fb352 |
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 saw you were fighting with this, in the end you'll update it manually for each release?
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.
Could you pull in https://github.com/actions/github-script and call hashFiles
directly from JS?
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.
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.
you'll update it manually for each release
yes, but only if requirements.txt
changes
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.
and call
hashFiles
directly from JS?
maybe, but I'd prefer not to add more complexity
Amazing! Congrats, it looked like a very hard labor. It's funny how 15MB can cut 3.5min to 15 seconds |
Found two bugs or undocumented edge cases where |
No description provided.