Skip to content

Commit

Permalink
ci: add NuGet packages.lock.json and cache NuGet folder
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer committed Nov 10, 2023
1 parent 4dc7b12 commit 94fb7c4
Show file tree
Hide file tree
Showing 20 changed files with 38,604 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ jobs:
- name: Remove latest .NET SDK (7.0.400)
run: sudo rm -rf ${DOTNET_ROOT}/sdk/7.0.400

- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ jobs:
- name: dotnet info
run: dotnet --info

- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
# https://github.com/actions/runner-images/blob/ubuntu22/20230821.1/images/linux/Ubuntu2204-Readme.md
# There is an issue with latest SDK on Linux with .NET Framework:
# https://github.com/microsoft/vstest/issues/4549
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ jobs:
- name: Remove latest .NET SDK (7.0.400)
run: sudo rm -rf ${DOTNET_ROOT}/sdk/7.0.400

- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install Sonar scanner
run: dotnet tool install --global dotnet-sonarscanner

Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<NoWarn Condition="'$(Configuration)'=='Release'">$(NoWarn);NETSDK1138</NoWarn>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;NU1701</WarningsAsErrors>
<ContinuousIntegrationBuild Condition="'$(Configuration)'=='Release'">true</ContinuousIntegrationBuild>
<RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)'=='true'">true</RestoreLockedMode>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<PropertyGroup>
Expand Down
Loading

0 comments on commit 94fb7c4

Please sign in to comment.