-
Notifications
You must be signed in to change notification settings - Fork 478
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
.NET installations are not being cached #141
Comments
It seems like it was removed with #124: |
Will this be fixed sometime soon? |
This should be updated to use the tool-cache package |
The actual work is being done by the powershell/bash |
Though I guess EDIT: Seems like |
@GGG-KILLER you're right, my bad. I suppose it could be a composite action and integrate the actions/cache action but maybe that should be left up to the consumer instead. |
I'm not up on my news, v2 of the cache action has a cache npm package, so this could be directly used without needing to make a composite action: |
Iirc, this package used to use the cache package, but after changing to the |
Any news? |
|
Seems like we could get caching working again relatively easy: setup-dotnet/externals/install-dotnet.ps1 Line 1072 in 4997896
setup-dotnet/externals/install-dotnet.sh Line 1194 in 4997896
by fixing the InstallRoot to the same location as GitHub action runners for windows and ubuntu respectively. I believe MacOS is already using the correct caching location. |
That is not the reason why installations aren't being cached though. That's the reason why the preinstalled versions aren't being used. These are two separate issues. Now that the hosted runner images aren't going to include .NET anymore, I think this is even more relevant as we won't be able to take advantage of .NET being preinstalled on the runners. |
actions/runner-images#3809 latest patch for every feature version should still be installed. Why not combine preinstalled with caching? I don't see it as separate issues. |
Actually they have said they don't plan to install newer versions of .NET for now: actions/runner-images#4424 (comment) And this is still a different issue if a workflow needs a specific version of .NET or a version that is not preinstalled. And it has been mentioned v2 of this action will use the correct installation paths for Windows and Linux. |
Sadly @miketimofeev statement is very vague and is not made as an announcement post, other users asked clarifying questions in the comments below that comment. How about working with what we have now? We have several preinstalled .NET installation that can be considered as an cache that you potentially don't have to reinstall.
What's wrong with globaljson for specific version and using setup-dotnet to ensure that version is installed? |
That in subsequent runs, that version would not be cached in the runner thus having to be installed every single time, which depending on the amount of versions you have to install may be up to a minute. Using the preinstalled versions is covered by #208. |
not yet worked on? using a very slow internet here at home, downloading .net 7 every run.... maybe In my case I should use other docker image which already has .net 7 there, right? |
I am also experiencing something related in our self-hosted runners. In my open source project on Github.com I can see that the script reports that .net is detected and not installed (after 3secs 🥳 ): But on our self-hosted runner in our GitHub Enterprise Server where we have installed the latest .net SDK 7 on the system globally, the action installs the SDK again on every run (~2 minutes 😱): We just do: - uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0" |
Hi, @Danielku15 👋 Thanks for the comment! Could you check that when you installed some exact version of the .NET sdk (let's say 7.0.306) via the action it also appears in the list formed by |
This is cmd screenshot above (3nd screenshot). We have installed 7.0.400 on the VM hosting the Actions Runner and it is listed in the SDKs. The same version is claimed to be installed in the logs of the runner (2rd screenshot).
I found the problem already. We had an environment variable I guess the system could still detect that a 7.0 is installed and use it, but that seems unnecessary complex considering the version wildcards. Hopefully this insight helps others. |
However, even after I create the global.json file specifying that I want to use version 7.0, it still always installs the latest version(8.0), for me, before finally installing the version specified by the dotnet-version parameter(7.0) for me. |
Any news? |
Any news? |
Description
.NET installations aren't being cached even when the same version remains the same between workflow runs.
Details
I have a workflow that uses .NET Core 2.1, 3.1 and 5.0 side-by-side and it has been downloading and installing these versions even when they haven't changed in different workflow runs:
3 runs with the same versions:
In all of these runs the installation wasn't cached.
This seems to be a regression, since before this action started using
install-dotnet.sh
/install-dotnet.ps1
they were being cached and the README still states that the installed versions should be cached.The text was updated successfully, but these errors were encountered: