Skip to content

Commit 9826230

Browse files
authored
Merge pull request #19 from TBSniller/fix/dependabot-checks
fix dependabot checks
2 parents f121e7e + 94a8c5f commit 9826230

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2
22
multi-ecosystem-groups:
33
bundled-dependencies:
4+
open-pull-requests-limit: 1
45
schedule:
56
interval: "weekly"
67
day: "monday"
@@ -13,14 +14,12 @@ multi-ecosystem-groups:
1314
updates:
1415
- package-ecosystem: "nuget"
1516
directory: "/"
16-
open-pull-requests-limit: 1
1717
patterns:
1818
- "*"
1919
multi-ecosystem-group: "bundled-dependencies"
2020

2121
- package-ecosystem: "github-actions"
2222
directory: "/"
23-
open-pull-requests-limit: 1
2423
patterns:
2524
- "*"
2625
multi-ecosystem-group: "bundled-dependencies"

.github/workflows/dotnet-ci.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
DOTNET_NOLOGO: true
2121
DOTNET_CLI_TELEMETRY_OPTOUT: true
2222
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
23+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
2324
steps:
2425
- name: Checkout repository
2526
uses: actions/checkout@v6
@@ -32,19 +33,31 @@ jobs:
3233
with:
3334
dotnet-version: "10.0.x"
3435

35-
- name: Cache NuGet packages
36-
uses: actions/cache@v4
36+
- name: Restore NuGet cache
37+
id: nuget-cache
38+
uses: actions/cache/restore@v4
3739
with:
38-
path: ~/.nuget/packages
40+
path: ${{ env.NUGET_PACKAGES }}
3941
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props', '**/global.json', '**/nuget.config') }}
4042
restore-keys: |
4143
${{ runner.os }}-nuget-
4244
45+
- name: Ensure NuGet packages directory exists
46+
shell: pwsh
47+
run: New-Item -ItemType Directory -Path "${{ env.NUGET_PACKAGES }}" -Force | Out-Null
48+
4349
- name: Restore dependencies
44-
run: dotnet restore
50+
run: dotnet restore --packages "${{ env.NUGET_PACKAGES }}"
4551

4652
- name: Build
4753
run: dotnet build --configuration Release --no-restore
4854

4955
- name: Test
5056
run: dotnet test --no-build --verbosity normal
57+
58+
- name: Save NuGet cache
59+
if: always() && steps.nuget-cache.outputs.cache-hit != 'true'
60+
uses: actions/cache/save@v4
61+
with:
62+
path: ${{ env.NUGET_PACKAGES }}
63+
key: ${{ steps.nuget-cache.outputs.cache-primary-key }}

.github/workflows/dotnet-publish.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
DOTNET_NOLOGO: true
1919
DOTNET_CLI_TELEMETRY_OPTOUT: true
2020
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
21+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
2122
outputs:
2223
new_tag: ${{ steps.tag.outputs.new_tag }}
2324
previous_tag: ${{ steps.tag.outputs.previous_tag }}
@@ -33,14 +34,19 @@ jobs:
3334
with:
3435
dotnet-version: "10.0.x"
3536

36-
- name: Cache NuGet packages
37-
uses: actions/cache@v4
37+
- name: Restore NuGet cache
38+
id: nuget-cache
39+
uses: actions/cache/restore@v4
3840
with:
39-
path: ~/.nuget/packages
41+
path: ${{ env.NUGET_PACKAGES }}
4042
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props', '**/global.json', '**/nuget.config') }}
4143
restore-keys: |
4244
${{ runner.os }}-nuget-
4345
46+
- name: Ensure NuGet packages directory exists
47+
shell: pwsh
48+
run: New-Item -ItemType Directory -Path "${{ env.NUGET_PACKAGES }}" -Force | Out-Null
49+
4450
- name: Determine next release tag
4551
id: tag
4652
shell: pwsh
@@ -63,7 +69,7 @@ jobs:
6369
"previous_tag=$latestTag" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
6470
6571
- name: Restore dependencies
66-
run: dotnet restore
72+
run: dotnet restore --packages "${{ env.NUGET_PACKAGES }}"
6773

6874
- name: Build
6975
run: dotnet build --configuration Release --no-restore
@@ -81,6 +87,13 @@ jobs:
8187
path: publish/*.exe
8288
if-no-files-found: error
8389

90+
- name: Save NuGet cache
91+
if: always() && steps.nuget-cache.outputs.cache-hit != 'true'
92+
uses: actions/cache/save@v4
93+
with:
94+
path: ${{ env.NUGET_PACKAGES }}
95+
key: ${{ steps.nuget-cache.outputs.cache-primary-key }}
96+
8497
release:
8598
if: github.ref == 'refs/heads/main'
8699
needs: build

0 commit comments

Comments
 (0)