Skip to content

Commit ccc149c

Browse files
authored
chore(Action): add cache nuget step (#6845)
* chore: add cache action * chore: update pack/pull actions * chore: update cache key * chore: remove dev branch tag * chore: update char * chore: update char
1 parent 217da3d commit ccc149c

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.github/workflows/auto-pull-request-checks.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- master
77
- main
8-
- dev
98

109
jobs:
1110
run_test:
@@ -20,6 +19,17 @@ jobs:
2019
with:
2120
dotnet-version: 9.0.x
2221

22+
- name: Cache NuGet packages
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.nuget/packages
26+
key: ${{runner.os}}-nuget-bb-${{hashFiles('**/*.csproj')}}
27+
restore-keys: |
28+
${{runner.os}}-nuget-bb-
29+
30+
- name: Restore dependencies
31+
run: dotnet restore src/BootstrapBlazor
32+
2333
- name: Test
2434
run: |
2535
dotnet test test/UnitTest --collect:"XPlat Code Coverage"

.github/workflows/build.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- master
77
- main
8-
- dev
98

109
jobs:
1110
build:
@@ -19,12 +18,22 @@ jobs:
1918
with:
2019
dotnet-version: 9.0.x
2120

21+
- name: Cache NuGet packages
22+
uses: actions/cache@v4
23+
with:
24+
path: ~/.nuget/packages
25+
key: ${{runner.os}}-nuget-bb-${{hashFiles('**/*.csproj')}}
26+
restore-keys: |
27+
${{runner.os}}-nuget-bb-
28+
29+
- name: Restore dependencies
30+
run: dotnet restore src/BootstrapBlazor
31+
2232
- name: Build
2333
env:
2434
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}
2535
Bundle: True
2636
run: |
27-
dotnet restore src/BootstrapBlazor --no-cache
2837
dotnet build src/BootstrapBlazor
2938
3039
- name: Test

.github/workflows/pack.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ jobs:
2222
with:
2323
dotnet-version: 9.0.x
2424

25+
- name: Cache NuGet packages
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.nuget/packages
29+
key: ${{runner.os}}-nuget-bb-${{hashFiles('**/*.csproj')}}
30+
restore-keys: |
31+
${{runner.os}}-nuget-bb-
32+
33+
- name: Restore dependencies
34+
run: dotnet restore src/BootstrapBlazor
35+
2536
- name: NuGet login
2637
uses: NuGet/login@v1
2738
id: login

0 commit comments

Comments
 (0)