Skip to content

Commit 3a9650e

Browse files
github-actions[bot]Copilot
authored andcommitted
Improve CI performance: NuGet caching + skip GenerateDocs on Windows (#1001)
- Add actions/cache@v4 for NuGet packages (keyed on Directory.Packages.props, global.json, and .config/dotnet-tools.json) to both workflow files. Subsequent runs restore the package cache, avoiding re-downloading packages. - Add whenNot { envVar "RUNNER_OS" "Windows" } to the GenerateDocs stage in build.fsx so that the docs-generation step (fsdocs install + build) is skipped on Windows CI runners. Docs are only deployed from Linux, so this step adds no value on Windows and can take several minutes. Closes #1001 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1507285 commit 3a9650e

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/pull-requests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v6
27+
- name: Cache NuGet packages
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.nuget/packages
31+
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props', 'global.json', '.config/dotnet-tools.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-nuget-
2734
- name: Setup .NET Core
2835
uses: actions/setup-dotnet@v5
2936
- name: Run CI

.github/workflows/push-main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v6
19+
- name: Cache NuGet packages
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.nuget/packages
23+
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props', 'global.json', '.config/dotnet-tools.json') }}
24+
restore-keys: |
25+
${{ runner.os }}-nuget-
1926
- name: Setup .NET Core
2027
uses: actions/setup-dotnet@v5
2128
- name: Run CI

build.fsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ pipeline "CI" {
6262
testStage
6363

6464
stage "GenerateDocs" {
65+
// Skip on Windows CI runners: docs are only deployed from Linux
66+
whenNot { envVar "RUNNER_OS" "Windows" }
67+
6568
run (fun _ ->
6669
Shell.cleanDir ".fsdocs"
6770
Shell.cleanDir ".packages")

0 commit comments

Comments
 (0)