Skip to content

Commit 3447fd6

Browse files
nogic1008IvanZosimovIvanZosimov
authored
feat: Cache NuGet global-packages folder (#303)
* feat: cache NuGet global-packages folder * fix: remove unused files * docs: fix incorrect action * ci: add e2e test for cache * docs: accept suggested changes on README * docs: add simple cache example * build: change main script path * fix: change relative path to install scripts * fix: change relative path to problem matcher * refactor: accept changes on cache-utils * fix: revert main script path changes * test: fix cache-utils unit test * test: fix cache-utils unit test * feat: add `cache-dependency-path` variables * build: change main script dist path * ci: add `cache-dependency-path` e2e test & missing lock file * fix: accept change suggestions * ci: copy NuGet lock file to root to pass "test-setup-with-cache" e2e test * docs: change README guide * fix: apply suggestions from code review Co-authored-by: Ivan <[email protected]> * test: fix some failed unit tests - fix `restoreCache()` test for 9703c8 - update installer script * build: rebuild dist * Update unit-tests - Additional unit test were added to setup-dotnet.test.ts * Update unit tests for unix systems * Format and lint unit tests * fix: avoid use '/' on `path.join` * fix: rebuild dist * fix: apply suggestions from code review Co-authored-by: Ivan <[email protected]> * build: add `DisableImplicitNuGetFallbackFolder` option also add guide on README * docs: highlight warnings and notes * docs: update note about handling NU1403 --------- Co-authored-by: Ivan <[email protected]> Co-authored-by: IvanZosimov <[email protected]>
1 parent 916351a commit 3447fd6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+136600
-22565
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,66 @@ jobs:
251251
shell: pwsh
252252
run: __tests__/verify-dotnet.ps1 -Patterns "^7\.0\.\d+-"
253253

254+
test-setup-with-cache:
255+
runs-on: ${{ matrix.operating-system }}
256+
strategy:
257+
fail-fast: false
258+
matrix:
259+
operating-system: [ubuntu-latest, windows-latest, macos-latest]
260+
env:
261+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
262+
steps:
263+
- name: Checkout
264+
uses: actions/checkout@v3
265+
- name: Clear toolcache
266+
shell: pwsh
267+
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
268+
- name: Copy NuGet lock file to root
269+
shell: bash
270+
run: cp ./__tests__/e2e-test-csproj/packages.lock.json ./packages.lock.json
271+
- name: Setup .NET Core 3.1
272+
id: setup-dotnet
273+
uses: ./
274+
with:
275+
dotnet-version: 3.1
276+
cache: true
277+
- name: Verify Cache
278+
if: steps.setup-dotnet.outputs.cache-hit == 'true'
279+
shell: bash
280+
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
281+
- name: Verify dotnet
282+
shell: pwsh
283+
run: __tests__/verify-dotnet.ps1 -Patterns "^3.1"
284+
285+
test-setup-with-cache-dependency-path:
286+
runs-on: ${{ matrix.operating-system }}
287+
strategy:
288+
fail-fast: false
289+
matrix:
290+
operating-system: [ubuntu-latest, windows-latest, macos-latest]
291+
env:
292+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
293+
steps:
294+
- name: Checkout
295+
uses: actions/checkout@v3
296+
- name: Clear toolcache
297+
shell: pwsh
298+
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
299+
- name: Setup .NET Core 3.1
300+
id: setup-dotnet
301+
uses: ./
302+
with:
303+
dotnet-version: 3.1
304+
cache: true
305+
cache-dependency-path: './__tests__/e2e-test-csproj/packages.lock.json'
306+
- name: Verify Cache
307+
if: steps.setup-dotnet.outputs.cache-hit == 'true'
308+
shell: bash
309+
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
310+
- name: Verify dotnet
311+
shell: pwsh
312+
run: __tests__/verify-dotnet.ps1 -Patterns "^3.1"
313+
254314
test-dotnet-version-output-during-single-version-installation:
255315
runs-on: ${{ matrix.operating-system }}
256316
strategy:

.licensed.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sources:
33

44
allowed:
55
- apache-2.0
6+
- 0bsd
67
- bsd-2-clause
78
- bsd-3-clause
89
- isc
@@ -11,4 +12,5 @@ allowed:
1112
- unlicense
1213

1314
reviewed:
14-
npm:
15+
npm:
16+
- sax # ISC + MIT

.licenses/npm/@actions/cache.dep.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/glob-0.1.2.dep.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@actions/glob-0.3.0.dep.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@azure/abort-controller.dep.yml

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@azure/core-auth.dep.yml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@azure/core-http.dep.yml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@azure/core-lro.dep.yml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/@azure/core-paging.dep.yml

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)