Skip to content

Commit ef95c47

Browse files
dsymegithub-actions[bot]Copilot
authored
[Repo Assist] ci: add NuGet and FAKE build caching to CI workflows (#495)
Cache ~/.nuget/packages keyed on paket.lock + dotnet-tools.json and cache the FAKE build-script compilation directory (.fake/) keyed on build.fsx + build.fsx.lock. On cache hits subsequent runs skip the NuGet download step entirely, which is usually the slowest part of CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 534a8d6 commit ef95c47

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@ jobs:
2828
with:
2929
dotnet-version: 6.0.425
3030

31+
- name: Cache NuGet packages
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.nuget/packages
35+
key: ${{ runner.os }}-nuget-${{ hashFiles('paket.lock', '.config/dotnet-tools.json') }}
36+
restore-keys: |
37+
${{ runner.os }}-nuget-
38+
39+
- name: Cache FAKE build artifacts
40+
uses: actions/cache@v4
41+
with:
42+
path: .fake
43+
key: ${{ runner.os }}-fake-${{ hashFiles('build.fsx', 'build.fsx.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-fake-
46+
3147
- name: Build on Windows
3248
if: matrix.os == 'windows-latest'
3349
run: .\build.cmd

.github/workflows/push.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ jobs:
3232
with:
3333
dotnet-version: 6.0.425
3434

35+
- name: Cache NuGet packages
36+
uses: actions/cache@v4
37+
with:
38+
path: ~/.nuget/packages
39+
key: ${{ runner.os }}-nuget-${{ hashFiles('paket.lock', '.config/dotnet-tools.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-nuget-
42+
43+
- name: Cache FAKE build artifacts
44+
uses: actions/cache@v4
45+
with:
46+
path: .fake
47+
key: ${{ runner.os }}-fake-${{ hashFiles('build.fsx', 'build.fsx.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-fake-
50+
3551
- name: Build on Windows
3652
if: matrix.os == 'windows-latest'
3753
run: .\build.cmd

0 commit comments

Comments
 (0)