4444 Directory.Packages.props
4545 **/*.csproj
4646
47+ - name : Restore bin/obj cache
48+ id : cache
49+ uses : actions/cache/restore@v3
50+ with :
51+ path : |
52+ **/bin
53+ **/obj
54+ key : ${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }}
55+
4756 - name : Restore dependencies
4857 run : dotnet restore ProtoActor.sln
4958
5362 ConnectionStrings__Redis : localhost:${{ job.services.redis.ports[6379] }},syncTimeout=10000
5463 run : |
5564 dotnet test ${{ matrix.test }} -c Release -f ${{ matrix.dotnet }} --logger GitHubActions
65+
66+ - name : Save bin/obj cache
67+ if : steps.cache.outputs.cache-hit != 'true'
68+ uses : actions/cache/save@v3
69+ with :
70+ path : |
71+ **/bin
72+ **/obj
73+ key : ${{ steps.cache.outputs.cache-primary-key }}
5674
5775 test-fast : # fast tests where setting up a parallel job run is more overhead than just running the tests side by side
5876 runs-on : ubuntu-latest
@@ -79,13 +97,31 @@ jobs:
7997 Directory.Packages.props
8098 **/*.csproj
8199
100+ - name : Restore bin/obj cache
101+ id : cache
102+ uses : actions/cache/restore@v3
103+ with :
104+ path : |
105+ **/bin
106+ **/obj
107+ key : ${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }}
108+
82109 - name : Restore dependencies
83110 run : dotnet restore ProtoActor.sln
84111 - name : Run tests ${{ matrix.test }}
85112 timeout-minutes : 15
86113 run : |
87114 dotnet test ${{ matrix.test }} -c Release --logger GitHubActions
88115
116+ - name : Save bin/obj cache
117+ if : steps.cache.outputs.cache-hit != 'true'
118+ uses : actions/cache/save@v3
119+ with :
120+ path : |
121+ **/bin
122+ **/obj
123+ key : ${{ steps.cache.outputs.cache-primary-key }}
124+
89125 nuget :
90126 runs-on : ubuntu-latest
91127 needs : [test-slow, test-fast]
@@ -103,10 +139,28 @@ jobs:
103139 Directory.Packages.props
104140 **/*.csproj
105141
142+ - name : Restore bin/obj cache
143+ id : cache
144+ uses : actions/cache/restore@v3
145+ with :
146+ path : |
147+ **/bin
148+ **/obj
149+ key : ${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }}
150+
106151 - name : Restore dependencies
107152 run : dotnet restore ProtoActor.sln
108153
109154 - name : Create and push NuGet package
110155 run : |
111156 dotnet pack ProtoActor.sln -c Release -o nuget -p:SymbolPackageFormat=snupkg -p:GenerateDocumentationFile=true -p:NoWarn=CS1591
112157 dotnet nuget push nuget/**/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
158+
159+ - name : Save bin/obj cache
160+ if : steps.cache.outputs.cache-hit != 'true'
161+ uses : actions/cache/save@v3
162+ with :
163+ path : |
164+ **/bin
165+ **/obj
166+ key : ${{ steps.cache.outputs.cache-primary-key }}
0 commit comments