From 7358a445904166c3f83f0d04320d96f189925490 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Wed, 12 Apr 2023 16:44:51 +0200 Subject: [PATCH] Update unit tests --- .github/workflows/e2e-tests.yml | 6 +++--- dist/index.js | 3 ++- src/installer.ts | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f3588e8..551ad8c 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -177,17 +177,17 @@ jobs: - name: Clear toolcache shell: pwsh run: __tests__/clear-toolcache.ps1 ${{ runner.os }} - - name: Setup dotnet '5.0.1xx' + - name: Setup dotnet '5.0.2xx' uses: ./ with: - dotnet-version: '5.0.1xx' + dotnet-version: '5.0.2xx' - name: Setup dotnet '7.0.1xx' uses: ./ with: dotnet-version: '7.0.1xx' - name: Verify dotnet shell: pwsh - run: __tests__/verify-dotnet.ps1 5.0.1 7.0.1 + run: __tests__/verify-dotnet.ps1 5.0.2 7.0.1 test-setup-global-json-specified-and-version: runs-on: ${{ matrix.operating-system }} diff --git a/dist/index.js b/dist/index.js index ed522cc..a9e8a7e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -290,9 +290,10 @@ class DotnetVersionResolver { this.resolvedArgument.value = yield this.getLatestByMajorTag(major); } else { + // Resolve LTS version of .NET if "dotnet-version" is specified as *, x or X this.resolvedArgument.value = 'LTS'; } - this.resolvedArgument.qualityFlag = +major >= 6 ? true : false; + this.resolvedArgument.qualityFlag = parseInt(major) >= 6 ? true : false; }); } createDotNetVersion() { diff --git a/src/installer.ts b/src/installer.ts index 9b85f7b..211c6c7 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -70,9 +70,10 @@ export class DotnetVersionResolver { } else if (this.isNumericTag(major)) { this.resolvedArgument.value = await this.getLatestByMajorTag(major); } else { + // Resolve LTS version of .NET if "dotnet-version" is specified as *, x or X this.resolvedArgument.value = 'LTS'; } - this.resolvedArgument.qualityFlag = +major >= 6 ? true : false; + this.resolvedArgument.qualityFlag = parseInt(major) >= 6 ? true : false; } public async createDotNetVersion(): Promise {