Skip to content
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

Add cache for Nuget packages #1439

Merged
merged 4 commits into from
Nov 29, 2020

Conversation

AlexNDRmac
Copy link
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

  • Added cache action for Nuget packages for speedup Nuget restore before each CI builds

@AlexNDRmac
Copy link
Contributor Author

AlexNDRmac commented Nov 24, 2020

@antonfirsov current summary restoring time for all projects is about ~1 minutes. With cache (next time, when you will build with enabled cache action) summary restore time should be ~5-10 seconds.
I guess, you can compare build time for each OS by triggering build action again.
Cache key based on all files in repository with .csproj extension, so any changes with packages will be change hash of cache key.

Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haven't captured all the files that could end up changing the packages

id: nuget-cache
with:
path: ~/.nuget
key: ${{ runner.os }}-nuget-${{ hashFiles('**/ImageSharp*.csproj') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will need to add the *.props/*.targets too as we define most of our package versions in those shared locations i.e.

<ItemGroup>
<!--Global Dependencies-->
<PackageReference Update="Microsoft.Net.Compilers.Toolset" PrivateAssets="All" Version="3.7.0" />
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />
<!--Src Dependencies-->
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Update="MinVer" PrivateAssets="All" Version="2.3.1" />
<PackageReference Update="System.Buffers" Version="4.5.1" />
<PackageReference Update="System.IO.Compression" Version="4.3.0" />
<PackageReference Update="System.IO.UnmanagedMemoryStream" Version="4.3.0" />
<PackageReference Update="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" />
<PackageReference Update="System.Threading.Tasks.Parallel" Version="4.3.0" />
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Added with next commit.

@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #1439 (30e4c90) into master (05659b8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1439   +/-   ##
=======================================
  Coverage   83.68%   83.68%           
=======================================
  Files         734      734           
  Lines       31990    31990           
  Branches     3605     3605           
=======================================
  Hits        26772    26772           
  Misses       4505     4505           
  Partials      713      713           
Flag Coverage Δ
unittests 83.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cad52a2...30e4c90. Read the comment docs.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Looks like everything is covered here now. Let's give it a whirl!

@JimBobSquarePants JimBobSquarePants merged commit 976bdd5 into SixLabors:master Nov 29, 2020
@AlexNDRmac AlexNDRmac deleted the ci-cache-action branch November 29, 2020 14:43
JimBobSquarePants added a commit that referenced this pull request Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants