Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache GitHub Actions #565

Merged
merged 11 commits into from
Nov 3, 2023
16 changes: 15 additions & 1 deletion .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
- ".github/pull_request_template.md"
- "README.md"

env:
# We install the packages to the D:\ drive to avoid the slow IO on the C:\ drive.
# Based on https://github.com/actions/setup-dotnet/issues/260#issuecomment-1790162905
NUGET_PACKAGES: D:\a\.nuget\packages

jobs:
commit:
strategy:
Expand All @@ -26,7 +31,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ matrix.platform }}-nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: |
${{ matrix.platform }}-nuget-${{ hashFiles('Directory.Packages.props') }}
${{ matrix.platform }}-nuget-

- name: Restore dependencies
run: |
Expand Down