Skip to content

Commit

Permalink
Test Caching NuGet Dependencies for Linux and Windows GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jrnelson90 committed Dec 7, 2023
1 parent 32c5425 commit e6ae12f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/8_0_Core_Unit_Tests_Linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ jobs:
- name: Pull step-ca Docker Image
run: docker pull smallstep/step-ca

- name: Cache NuGet Dependencies
uses: actions/cache@v3
with:
path: $HOME/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Install Dependencies & Build Certify.Core.Tests.Unit
run: |
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/8_0_Core_Unit_Tests_Win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,22 @@ jobs:
- name: Pull step-ca Docker Image
run: docker pull jrnelson90/step-ca-win

- name: Cache NuGet Dependencies
uses: actions/cache@v3
with:
path: C:\%HOME_PATH%\.nuget\packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('./certify/src/Certify.Tests/Certify.Core.Tests.Unit/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Install Dependencies & Build Certify.Core.Tests.Unit
run: |
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.2.0
dotnet add package GitHubActionsTestLogger
dotnet build -c Debug -f net8.0 --property WarningLevel=0 /clp:ErrorsOnly
working-directory: ./certify/src/Certify.Tests/Certify.Core.Tests.Unit

- name: Run Certify.Core.Tests.Unit Tests
run: |
$env:GITHUB_WORKSPACE="$env:GITHUB_WORKSPACE\certify"
Expand Down

0 comments on commit e6ae12f

Please sign in to comment.