Skip to content

Commit

Permalink
Cache NuGet packages. (#78)
Browse files Browse the repository at this point in the history
* Cache NuGet packages.

* Lock File for Cmdlets.

* NuGet Cache.

* Cache VS

* Lock Files.

* Use NuGet Caching.

* Lock Files.

* Test Caching.

* Packager Changes.

* Test Caching.

* Cache .NET Framework Packages.

* Remove Restore Condition.

* Add Condition Back For Testing.

* Include Condition.
  • Loading branch information
adamdriscoll committed Jul 18, 2024
1 parent fab45fc commit e2c6731
Show file tree
Hide file tree
Showing 46 changed files with 14,141 additions and 17 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/cmdlets.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Restore
shell: pwsh
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/cmdlets.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ jobs:
with:
dotnet-version: 6.0.x

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Add msbuild to PATH
uses: microsoft/[email protected]

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hosts.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
cache: true
cache-dependency-path: IronmanPowerShellHost/packages.lock.json

- name: Build Ironman Host
shell: pwsh
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hosts.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
cache: true
cache-dependency-path: IronmanPowerShellHost/packages.lock.json

- name: Build and Release
shell: pwsh
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/vs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Restore
shell: pwsh
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/vscode.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Restore
shell: pwsh
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/vscode.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Restore
shell: pwsh
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/winformdesigner.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Restore
shell: pwsh
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/winformdesigner.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- uses: actions/cache@v4
id: cache
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}

- uses: actions/cache@v4
id: cache2
with:
path: .\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}

- name: Restore
shell: pwsh
run: |
Expand Down
1 change: 1 addition & 0 deletions Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Build\FinalPublicKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit e2c6731

Please sign in to comment.