-
Notifications
You must be signed in to change notification settings - Fork 766
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
Caching on GHES #308
Caching on GHES #308
Conversation
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "setup-java", | |||
"version": "2.0.0", | |||
"version": "2.0.1", |
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 think we need to update the version according to the next release version.
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.
yes, we are planning to release after this PR merge
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 please change version 2.0.1 to the planing one ?
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.
@dmitry-shibanov , please share planned version
src/util.ts
Outdated
); | ||
} else { | ||
core.warning( | ||
'An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.' |
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.
Is this message accurate? It looks like cache.isFeatureAvailable()
just looks for whether an environment variable is set.
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 my understanding is correct, I would say something like
'An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.' | |
'This runner is not configured to use the cache service. Caching will be skipped.' |
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.
done
src/util.ts
Outdated
); | ||
} else { | ||
core.warning( | ||
'This runner is not configured to use the cache service. Caching will be skipped' |
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 we update to the same thing from actions/setup-python#363?
'This runner is not configured to use the cache service. Caching will be skipped' | |
'The runner was not able to contact the cache service. Caching will be skipped' |
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.
Updated with correct message
Looks like a test is failing: https://github.com/actions/setup-java/runs/5769289844?check_suite_focus=true#step:7:461 |
Yes this is failing on master as well #309 https://github.com/actions/setup-java/runs/5773757120?check_suite_focus=true#step:7:404 Update: |
Description:
![image](https://user-images.githubusercontent.com/64764738/160748429-48a051ce-74d6-46ed-b9ea-dd9b2b68190b.png)
This PR adds caching support in setup-java for GHES with version 3.5. It checks the presence of the Actions cache service(which is used for caching dependencies in GHES and dotcom) using the recent @actions/cache toolkit package function i.e isFeatureAvailable. This same function can be applied to dotcom scenario (github.com) so this function can be safely applied to dotcom scenario as well.
I have tested the below scenarios
on GHES
Current behaviour
With new changes. Without AC on GHES
![image](https://user-images.githubusercontent.com/64764738/160748931-ab6988c8-8fc1-4605-a757-6618995bda26.png)
With AC on GHES
![image](https://user-images.githubusercontent.com/64764738/160764042-9acf03c7-06f6-4afa-ba4b-85aed909fb9a.png)
![image](https://user-images.githubusercontent.com/64764738/160764463-c1573684-4bad-4597-8fca-bf54330f2f42.png)
save
restore
without choosing the cache option on GHES with AC
![image](https://user-images.githubusercontent.com/64764738/160765234-77431229-cb70-4320-b540-4d25655a30ed.png)
On dotcom
save
![image](https://user-images.githubusercontent.com/64764738/160752599-cb0215fe-2232-42d0-8865-e1b7c9a5b516.png)
cache hit
![image](https://user-images.githubusercontent.com/64764738/160752515-a378c4ff-76e3-4dfa-b408-e2f60891fd67.png)
without cache option
![image](https://user-images.githubusercontent.com/64764738/160752909-d0bb73a1-de16-4b73-87a1-15f3bb058a67.png)
Related issue:
#307
Check list: