Bump test dependencies to resolve System.Net.Http vulnerability, update workflows and README (#692)

* update test deps, workflows, and docs for latest versions

* fix wording

* update versions
This commit is contained in:
priya-kinthali
2026-01-14 04:37:38 +05:30
committed by GitHub
parent 24ec4f204b
commit baa11fbfe1
10 changed files with 328 additions and 1823 deletions

View File

@@ -17,235 +17,153 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 6.0.427, 7.0.410 and 7.0.x
- name: Setup dotnet 8.0.416, 8.0.x, 9.0.308 and 10.0.101
uses: ./
with:
dotnet-version: |
6.0.427
7.0.410
7.0.x
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0.427$", "^7.0.410$", "^7.0"
test-setup-multiple-versions-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0.403, 9.0.301 and 8.0.x
uses: ./
with:
dotnet-version: |
8.0.403
9.0.301
8.0.416
8.0.x
9.0.308
10.0.101
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0.403$", "^9.0.301$", "^8.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0.416$", "^9.0.308$", "^10.0.101$", "^8.0"
test-setup-full-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
# Side-by-side install of 6.0 and 7.0 used for the test project
- name: Setup dotnet 6.0.427
# Side-by-side install of 9.0 and 10.0 used for the test project
- name: Setup dotnet 9.0.308
uses: ./
with:
dotnet-version: 6.0.427
- name: Setup dotnet 7.0.410
dotnet-version: 9.0.308
- name: Setup dotnet 10.0.101
uses: ./
with:
dotnet-version: 7.0.410
dotnet-version: 10.0.101
# We are including this variable to force the generation of the nuget config file to verify that it is created in the correct place
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: NOTATOKEN
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^7.0.410$", "^6.0.427$" -CheckNugetConfig
test-setup-full-version-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
# Side-by-side install of 8.0 and 9.0 used for the test project
- name: Setup dotnet 8.0.402
uses: ./
with:
dotnet-version: 8.0.402
- name: Setup dotnet 9.0.301
uses: ./
with:
dotnet-version: 9.0.301
# We are including this variable to force the generation of the nuget config file to verify that it is created in the correct place
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: NOTATOKEN
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0.301$", "^8.0.402$" -CheckNugetConfig
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0.101$", "^9.0.308$" -CheckNugetConfig
test-setup-without-patch-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
# 6.0, 7.0 needs to be in single quotes to interpret as a string instead of as an integer
- name: Setup dotnet '6.0'
uses: ./
with:
dotnet-version: '6.0'
- name: Setup dotnet '7.0'
uses: ./
with:
dotnet-version: '7.0'
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0", "^7.0"
test-setup-without-patch-version-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
# 8.0, 9.0 needs to be in single quotes to interpret as a string instead of as an integer
- name: Setup dotnet '8.0'
uses: ./
with:
dotnet-version: '8.0'
# 9.0, 10.0 needs to be in single quotes to interpret as a string instead of as an integer
- name: Setup dotnet '9.0'
uses: ./
with:
dotnet-version: '9.0'
- name: Setup dotnet '10.0'
uses: ./
with:
dotnet-version: '10.0'
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^9.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
test-setup-prerelease-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet '6.0.100-preview.7.21379.14'
- name: Setup dotnet '10.0.100-preview.7.25380.108'
uses: ./
with:
dotnet-version: '6.0.100-preview.7.21379.14'
dotnet-version: '10.0.100-preview.7.25380.108'
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "6.0.100-preview.7.21379.14"
test-setup-prerelease-version-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet '8.0.100-preview.1.23115.2'
uses: ./
with:
dotnet-version: '8.0.100-preview.1.23115.2'
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "8.0.100-preview.1.23115.2"
run: __tests__/verify-dotnet.ps1 -Patterns "10.0.100-preview.7.25380.108"
test-setup-latest-patch-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 6.0.x
- name: Setup dotnet 9.0.x
uses: ./
with:
dotnet-version: 6.0.x
- name: Setup dotnet 7.0.X
dotnet-version: 9.0.x
- name: Setup dotnet 10.0.X
uses: ./
with:
dotnet-version: 7.0.X
dotnet-version: 10.0.X
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0", "^7.0"
test-setup-latest-patch-version-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0.x
uses: ./
with:
dotnet-version: 8.0.x
- name: Setup dotnet 9.0.X
uses: ./
with:
dotnet-version: 9.0.X
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^9.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
test-ABCxx-syntax:
runs-on: ${{ matrix.operating-system }}
@@ -253,7 +171,13 @@ jobs:
fail-fast: false
matrix:
operating-system:
[ubuntu-latest, windows-latest, macos-15-intel, macos-latest]
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -261,67 +185,58 @@ jobs:
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 6.0.4xx
- name: Setup dotnet 10.0.1xx
uses: ./
with:
dotnet-version: '6.0.4xx'
dotnet-version: '10.0.1xx'
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6\.0\.4\d{2}"
run: __tests__/verify-dotnet.ps1 -Patterns "^10\.0\.1\d{2}"
test-setup-with-wildcard:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 6.0.*
uses: ./
with:
dotnet-version: 6.0.*
- name: Setup dotnet 7.0.*
uses: ./
with:
dotnet-version: 7.0.*
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0", "^7.0"
test-setup-with-wildcard-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0.*
uses: ./
with:
dotnet-version: 8.0.*
- name: Setup dotnet 9.0.*
uses: ./
with:
dotnet-version: 9.0.*
- name: Setup dotnet 10.0.*
uses: ./
with:
dotnet-version: 10.0.*
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^9.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
test-setup-global-json-specified-and-version:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -332,47 +247,29 @@ jobs:
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "6.0.424","rollForward": "latestFeature"}}' > ./subdirectory/global.json
echo '{"sdk":{"version": "9.0.308","rollForward": "latestFeature"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
dotnet-version: 7.0
dotnet-version: '10.0'
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0", "^7.0"
test-setup-global-json-specified-and-version-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "8.0.402","rollForward": "latestFeature"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
dotnet-version: '9.0'
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0", "^9.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"
test-setup-global-json-only:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -383,46 +280,28 @@ jobs:
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "6.0.424","rollForward": "latestFeature"}}' > ./subdirectory/global.json
echo '{"sdk":{"version": "10.0.101","rollForward": "latestFeature"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0"
test-setup-global-json-only-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "6.0.424","rollForward": "latestFeature"}}' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
test-global-json-with-comments:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -433,39 +312,14 @@ jobs:
shell: bash
run: |
mkdir subdirectory
echo '/* should support comments */ {"sdk":{"version": "6.0.424","rollForward": "latestFeature"}} // should support comments' > ./subdirectory/global.json
echo '/* should support comments */ {"sdk":{"version": "10.0.101","rollForward": "latestFeature"}} // should support comments' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0"
test-global-json-with-comments-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '/* should support comments */ {"sdk":{"version": "8.0.402","rollForward": "latestFeature"}} // should support comments' > ./subdirectory/global.json
- name: Setup dotnet
uses: ./
with:
global-json-file: ./subdirectory/global.json
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
test-setup-with-dotnet-quality:
runs-on: ${{ matrix.operating-system }}
@@ -473,7 +327,13 @@ jobs:
fail-fast: false
matrix:
operating-system:
[ubuntu-latest, windows-latest, macos-15-intel, macos-latest]
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -481,21 +341,28 @@ jobs:
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 7.0 with preview quality
- name: Setup dotnet 10.0 with preview quality
uses: ./
with:
dotnet-version: '7.0'
dotnet-version: '10.0'
dotnet-quality: 'preview'
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^7\.0\.\d+-"
run: __tests__/verify-dotnet.ps1 -Patterns "^10\.0\.\d+-"
test-setup-with-cache:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
@@ -507,11 +374,11 @@ jobs:
- name: Copy NuGet lock file to root
shell: bash
run: cp ./__tests__/e2e-test-csproj/packages.lock.json ./packages.lock.json
- name: Setup .NET Core 6.0
- name: Setup .NET Core 10.0
id: setup-dotnet
uses: ./
with:
dotnet-version: 6.0
dotnet-version: '10.0'
cache: true
- name: Verify Cache
if: steps.setup-dotnet.outputs.cache-hit == 'true'
@@ -519,45 +386,21 @@ jobs:
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0"
test-setup-with-cache-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Copy NuGet lock file to root
shell: bash
run: cp ./__tests__/e2e-test-csproj/packages.lock.json ./packages.lock.json
- name: Setup .NET Core 8.0
id: setup-dotnet
uses: ./
with:
dotnet-version: '8.0'
cache: true
- name: Verify Cache
if: steps.setup-dotnet.outputs.cache-hit == 'true'
shell: bash
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
test-setup-with-cache-dependency-path:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
@@ -566,11 +409,11 @@ jobs:
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup .NET Core 6.0
- name: Setup .NET Core 10.0
id: setup-dotnet
uses: ./
with:
dotnet-version: 6.0
dotnet-version: '10.0'
cache: true
cache-dependency-path: './__tests__/e2e-test-csproj/packages.lock.json'
- name: Verify Cache
@@ -579,36 +422,7 @@ jobs:
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^6.0"
test-setup-with-cache-dependency-path-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup .NET Core 8.0
id: setup-dotnet
uses: ./
with:
dotnet-version: '8.0'
cache: true
cache-dependency-path: './__tests__/e2e-test-csproj/packages.lock.json'
- name: Verify Cache
if: steps.setup-dotnet.outputs.cache-hit == 'true'
shell: bash
run: if [[ -e ${NUGET_PACKAGES} ]]; then exit 0; else exit 1; fi
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0"
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0"
test-dotnet-version-output-during-single-version-installation:
runs-on: ${{ matrix.operating-system }}
@@ -616,7 +430,13 @@ jobs:
fail-fast: false
matrix:
operating-system:
[ubuntu-latest, windows-latest, macos-15-intel, macos-latest]
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -624,11 +444,11 @@ jobs:
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0.402
- name: Setup dotnet 10.0.101
uses: ./
id: step1
with:
dotnet-version: '8.0.402'
dotnet-version: '10.0.101'
- name: Verify value of the dotnet-version output
shell: pwsh
@@ -643,7 +463,13 @@ jobs:
fail-fast: false
matrix:
operating-system:
[ubuntu-latest, windows-latest, macos-15-intel, macos-latest]
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -651,19 +477,19 @@ jobs:
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0.402, 6.0.401, 7.0.100-rc.1.22431.12
- name: Setup dotnet 8.0.402, 9.0.308, 10.0.101
uses: ./
id: step2
with:
dotnet-version: |
10.0.101
9.0.308
8.0.402
6.0.401
7.0.100-rc.1.22431.12
- name: Verify value of the dotnet-version output
shell: pwsh
run: |
$version = "8.0.402"
$version = "10.0.101"
if (-not ($version -eq '${{steps.step2.outputs.dotnet-version}}')) { throw "Unexpected output value" }
test-proxy:
@@ -694,41 +520,19 @@ jobs:
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0
- name: Setup dotnet 10.0
uses: ./
with:
dotnet-version: 8.0
dotnet-version: 10.0
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: NOTATOKEN
- name: Verify dotnet
shell: pwsh
run: |
__tests__/verify-dotnet.ps1 -Patterns "^8.0" -CheckNugetConfig
__tests__/verify-dotnet.ps1 -Patterns "^10.0" -CheckNugetConfig
test-bypass-proxy:
runs-on: ubuntu-22.04
env:
https_proxy: http://no-such-proxy:3128
no_proxy: github.com,download.visualstudio.microsoft.com,api.nuget.org,builds.dotnet.microsoft.com,ci.dot.net
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 7.0.410
uses: ./
with:
dotnet-version: 7.0.410
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: NOTATOKEN
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^7.0.410$" -CheckNugetConfig
test-bypass-proxy-extended:
runs-on: ubuntu-latest
env:
https_proxy: http://no-such-proxy:3128
@@ -739,54 +543,32 @@ jobs:
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Setup dotnet 8.0.402
- name: Setup dotnet 10.0.101
uses: ./
with:
dotnet-version: 8.0.402
dotnet-version: 10.0.101
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: NOTATOKEN
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^8.0.402$" -CheckNugetConfig
run: __tests__/verify-dotnet.ps1 -Patterns "^10.0.101$" -CheckNugetConfig
test-sequential-version-installation:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-22.04, windows-latest, macos-15-intel]
lower-version: ['6.0.427']
higher-version: ['7.0.203']
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
# Install one version, use it for something, then switch to next version
- name: Setup dotnet (lower version)
uses: ./
with:
dotnet-version: ${{ matrix.lower-version }}
- name: Verify dotnet (lower version)
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$"
- name: Setup dotnet (higher version)
uses: ./
with:
dotnet-version: ${{ matrix.higher-version }}
- name: Verify dotnet (higher version)
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^${{ matrix.lower-version }}$", "^${{ matrix.higher-version }}$"
test-sequential-version-installation-extended:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
lower-version: ['8.0.403']
higher-version: ['9.0.301']
operating-system:
[
ubuntu-22.04,
ubuntu-latest,
windows-latest,
macos-latest,
macos-15-intel
]
lower-version: ['9.0.308']
higher-version: ['10.0.101']
steps:
- name: Checkout
uses: actions/checkout@v6

View File

@@ -25,7 +25,7 @@ jobs:
macos-15-intel,
macos-latest
]
dotnet-version: ['6.0', '7.0', '8.0', '9.0']
dotnet-version: ['8.0', '9.0', '10.0']
steps:
- name: Checkout
uses: actions/checkout@v6

View File

@@ -29,7 +29,7 @@ See [action.yml](action.yml)
**Basic**:
```yaml
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
@@ -40,7 +40,7 @@ steps:
**Multiple version installation**:
```yml
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
@@ -53,7 +53,7 @@ steps:
The `dotnet-version` input supports following syntax:
- **A.B.C** (e.g 6.0.400, 7.0.100-preview.7.22377.5) - installs exact version of .NET SDK
- **A.B.C** (e.g 9.0.308, 10.0.100-preview.1.25120.13) - installs exact version of .NET SDK
- **A.B** or **A.B.x** (e.g. 8.0, 8.0.x) - installs the latest patch version of .NET SDK on the channel `8.0`, including prerelease versions (preview, rc)
- **A** or **A.x** (e.g. 8, 8.x) - installs the latest minor version of the specified major tag, including prerelease versions (preview, rc)
- **A.B.Cxx** (e.g. 8.0.4xx) - available since `.NET 5.0` release. Installs the latest version of the specific SDK release, including prerelease versions (preview, rc).
@@ -66,7 +66,7 @@ This input sets up the action to install the latest build of the specified quali
```yml
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
@@ -81,7 +81,7 @@ steps:
```yml
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
global-json-file: csharp/global.json
@@ -98,7 +98,7 @@ The action searches for [NuGet Lock files](https://learn.microsoft.com/nuget/con
```yaml
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
@@ -123,7 +123,7 @@ steps:
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
@@ -137,7 +137,7 @@ steps:
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
@@ -154,10 +154,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '7.0.x', '8.0.x', '9.0.x' ]
dotnet: [ '8.0.x', '9.0.x', '10.0.x' ]
name: Dotnet ${{ matrix.dotnet }} sample
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
@@ -174,10 +174,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '7.0.x', '8.0.x', '9.0.x' ]
dotnet: [ '8.0.x', '9.0.x', '10.0.x' ]
name: Dotnet ${{ matrix.dotnet }} sample
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
id: stepid
@@ -188,12 +188,13 @@ jobs:
- name: Execute dotnet
run: dotnet build <my project>
```
>**Note**: When generating a temporary `global.json` within your workflow on Windows, ensure the command is executed using a shell such as PowerShell Core (`pwsh`) or `bash` (where supported) to avoid formatting inconsistencies that could cause .NET commands to fail.
## Setting up authentication for nuget feeds
### Github Package Registry (GPR)
```yml
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
@@ -246,8 +247,8 @@ In case of a single version installation, the `dotnet-version` output contains t
- uses: actions/setup-dotnet@v5
id: stepid
with:
dotnet-version: 8.0.402
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 8.0.402
dotnet-version: 8.0.416
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 8.0.416
```
**Multiple version installation**
@@ -259,9 +260,9 @@ In case of a multiple version installation, the `dotnet-version` output contains
id: stepid
with:
dotnet-version: |
8.0.402
9.0.301
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 9.0.301
8.0.416
9.0.308
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 9.0.308
```
**Installation from global.json**
@@ -272,10 +273,10 @@ When the `dotnet-version` input is used along with the `global-json-file` input,
id: stepid
with:
dotnet-version: |
8.0.402
9.0.301
global-json-file: "./global.json" # contains version 7.0.410
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 7.0.410
9.0.308
10.0.101
global-json-file: "./global.json" # contains version 8.0.416
- run: echo '${{ steps.stepid.outputs.dotnet-version }}' # outputs 8.0.416
```
### `cache-hit`
@@ -308,7 +309,7 @@ build:
DOTNET_INSTALL_DIR: "path/to/directory"
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'

View File

@@ -0,0 +1,4 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
// Sequential test execution
[assembly: DoNotParallelize]

View File

@@ -12,7 +12,7 @@ namespace test_csproj
Console.WriteLine("TestMethod");
int calculatedResult = 1000 / 25;
int expectedResult = 40;
Assert.AreEqual(calculatedResult, expectedResult);
Assert.AreEqual(expectedResult, calculatedResult);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -8,9 +8,9 @@
<ItemGroup>
<!-- These packages will be downloaded over the network for testing proxy settings -->
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170810-02" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
</ItemGroup>
</Project>

View File

@@ -38,7 +38,7 @@ describe('installer tests', () => {
});
it('should throw the error in case of non-zero exit code of the installation script. The error message should contain logs.', async () => {
const inputVersion = '3.1.100';
const inputVersion = '10.0.101';
const inputQuality = '' as QualityOptions;
const errorMessage = 'fictitious error message!';
@@ -60,7 +60,7 @@ describe('installer tests', () => {
});
it('should return version of .NET SDK after installation complete', async () => {
const inputVersion = '3.1.100';
const inputVersion = '10.0.101';
const inputQuality = '' as QualityOptions;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
getExecOutputSpy.mockImplementation(() => {
@@ -82,7 +82,7 @@ describe('installer tests', () => {
});
it(`should supply 'version' argument to the installation script if supplied version is in A.B.C syntax`, async () => {
const inputVersion = '6.0.300';
const inputVersion = '10.0.101';
const inputQuality = '' as QualityOptions;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
@@ -120,7 +120,7 @@ describe('installer tests', () => {
});
it(`should warn if the 'quality' input is set and the supplied version is in A.B.C syntax`, async () => {
const inputVersion = '6.0.300';
const inputVersion = '10.0.101';
const inputQuality = 'ga' as QualityOptions;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
getExecOutputSpy.mockImplementation(() => {
@@ -147,7 +147,7 @@ describe('installer tests', () => {
it(`should warn if the 'quality' input is set and version isn't in A.B.C syntax but major tag is lower then 6`, async () => {
const inputVersion = '3.1';
const inputQuality = 'ga' as QualityOptions;
const stdout = `Fictitious dotnet version 3.1.100 is installed`;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
getExecOutputSpy.mockImplementation(() => {
return Promise.resolve({
@@ -170,12 +170,12 @@ describe('installer tests', () => {
);
});
each(['6', '6.0', '6.0.x', '6.0.*', '6.0.X']).test(
each(['10', '10.0', '10.0.x', '10.0.*', '10.0.X']).test(
`should supply 'quality' argument to the installation script if quality input is set and version (%s) is not in A.B.C syntax`,
async inputVersion => {
const inputQuality = 'ga' as QualityOptions;
const exitCode = 0;
const stdout = `Fictitious dotnet version 6.0.0 is installed`;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
getExecOutputSpy.mockImplementation(() => {
return Promise.resolve({
exitCode: exitCode,
@@ -210,12 +210,12 @@ describe('installer tests', () => {
}
);
each(['6', '6.0', '6.0.x', '6.0.*', '6.0.X']).test(
each(['10', '10.0', '10.0.x', '10.0.*', '10.0.X']).test(
`should supply 'channel' argument to the installation script if version (%s) isn't in A.B.C syntax`,
async inputVersion => {
const inputQuality = '' as QualityOptions;
const exitCode = 0;
const stdout = `Fictitious dotnet version 6.0.0 is installed`;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
getExecOutputSpy.mockImplementation(() => {
return Promise.resolve({
exitCode: exitCode,
@@ -243,8 +243,8 @@ describe('installer tests', () => {
getExecOutputSpy.mock.calls[callIndex][1] as string[]
).join(' ');
const expectedArgument = IS_WINDOWS
? `-Channel 6.0`
: `--channel 6.0`;
? `-Channel 10.0`
: `--channel 10.0`;
expect(scriptArguments).toContain(expectedArgument);
}
@@ -253,7 +253,7 @@ describe('installer tests', () => {
if (IS_WINDOWS) {
it(`should supply '-ProxyAddress' argument to the installation script if env.variable 'https_proxy' is set`, async () => {
process.env['https_proxy'] = 'https://proxy.com';
const inputVersion = '6.0.100';
const inputVersion = '10.0.101';
const inputQuality = '' as QualityOptions;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
@@ -291,9 +291,9 @@ describe('installer tests', () => {
it(`should supply '-ProxyBypassList' argument to the installation script if env.variable 'no_proxy' is set`, async () => {
process.env['no_proxy'] = 'first.url,second.url';
const inputVersion = '6.0.100';
const inputVersion = '10.0.101';
const inputQuality = '' as QualityOptions;
const stdout = `Fictitious dotnet version 6.0.0 is installed`;
const stdout = `Fictitious dotnet version ${inputVersion} is installed`;
getExecOutputSpy.mockImplementation(() => {
return Promise.resolve({
@@ -349,14 +349,14 @@ describe('installer tests', () => {
describe('DotnetVersionResolver tests', () => {
describe('createDotnetVersion() tests', () => {
each([
'3.1',
'3.x',
'3.1.x',
'3.1.*',
'3.1.X',
'3.1.2',
'3.1.0-preview1',
'6.0.2xx'
'10.0',
'10.x',
'10.0.x',
'10.0.*',
'10.0.X',
'10.0.0',
'10.0.0-preview7',
'10.0.1xx'
]).test(
'if valid version is supplied (%s), it should return version object with some value',
async version => {
@@ -408,7 +408,7 @@ describe('installer tests', () => {
}
);
each(['3', '3.1', '3.1.x', '3.1.*', '3.1.X', '6.0.2xx']).test(
each(['10', '10.0', '10.0.x', '10.0.*', '10.0.X', '10.0.1xx']).test(
"if version that can be resolved to 'channel' option is supplied (%s), it should set type to 'channel' in version object",
async version => {
const dotnetVersionResolver = new installer.DotnetVersionResolver(
@@ -423,7 +423,7 @@ describe('installer tests', () => {
}
);
each(['6.0', '6.0.x', '6.0.*', '6.0.X', '6.0.2xx']).test(
each(['10.0', '10.0.x', '10.0.*', '10.0.X', '10.0.1xx']).test(
"if version that can be resolved to 'channel' option is supplied and its major tag is >= 6 (%s), it should set type to 'channel' and qualityFlag to 'true' in version object",
async version => {
const dotnetVersionResolver = new installer.DotnetVersionResolver(
@@ -439,7 +439,7 @@ describe('installer tests', () => {
}
);
each(['3.1.2', '3.1.0-preview1']).test(
each(['10.0.0', '10.0.0-preview7']).test(
"if version that can be resolved to 'version' option is supplied (%s), it should set quality flag to 'false' and type to 'version' in version object",
async version => {
const dotnetVersionResolver = new installer.DotnetVersionResolver(
@@ -455,7 +455,7 @@ describe('installer tests', () => {
}
);
each(['3.1.2', '3.1']).test(
each(['10.0.0', '10.0']).test(
'it should create proper line arguments for powershell/bash installation scripts',
async version => {
const dotnetVersionResolver = new installer.DotnetVersionResolver(

View File

@@ -81,7 +81,7 @@ describe('setup-dotnet tests', () => {
it('should fail the action if quality is supplied but its value is not supported', async () => {
inputs['global-json-file'] = '';
inputs['dotnet-version'] = ['6.0'];
inputs['dotnet-version'] = ['10.0'];
inputs['dotnet-quality'] = 'fictitiousQuality';
const expectedErrorMessage = `Value '${inputs['dotnet-quality']}' is not supported for the 'dotnet-quality' option. Supported values are: daily, signed, validated, preview, ga.`;
@@ -92,7 +92,7 @@ describe('setup-dotnet tests', () => {
it('should call installDotnet() multiple times if dotnet-version multiline input is provided', async () => {
inputs['global-json-file'] = '';
inputs['dotnet-version'] = ['6.0', '7.0'];
inputs['dotnet-version'] = ['9.0', '10.0'];
inputs['dotnet-quality'] = '';
installDotnetSpy.mockImplementation(() => Promise.resolve(''));
@@ -103,7 +103,7 @@ describe('setup-dotnet tests', () => {
it('should call addToPath() after installation complete', async () => {
inputs['global-json-file'] = '';
inputs['dotnet-version'] = ['6.0', '7.0'];
inputs['dotnet-version'] = ['9.0', '10.0'];
inputs['dotnet-quality'] = '';
installDotnetSpy.mockImplementation(() => Promise.resolve(''));
@@ -145,7 +145,7 @@ describe('setup-dotnet tests', () => {
});
it('should call setOutput() after installation complete successfully', async () => {
inputs['dotnet-version'] = ['6.0.300'];
inputs['dotnet-version'] = ['10.0.101'];
installDotnetSpy.mockImplementation(() =>
Promise.resolve(`${inputs['dotnet-version']}`)
@@ -156,7 +156,7 @@ describe('setup-dotnet tests', () => {
});
it(`shouldn't call setOutput() if parsing dotnet-installer logs failed`, async () => {
inputs['dotnet-version'] = ['6.0.300'];
inputs['dotnet-version'] = ['10.0.101'];
const warningMessage = `Failed to output the installed version of .NET. The 'dotnet-version' output will not be set.`;
installDotnetSpy.mockImplementation(() => Promise.resolve(null));
@@ -177,7 +177,7 @@ describe('setup-dotnet tests', () => {
});
it(`should get 'cache-dependency-path' and call restoreCache() if input cache is set to true and cache feature is available`, async () => {
inputs['dotnet-version'] = ['6.0.300'];
inputs['dotnet-version'] = ['10.0.101'];
inputs['dotnet-quality'] = '';
inputs['cache'] = true;
inputs['cache-dependency-path'] = 'fictitious.package.lock.json';
@@ -195,7 +195,7 @@ describe('setup-dotnet tests', () => {
});
it(`shouldn't call restoreCache() if input cache isn't set to true`, async () => {
inputs['dotnet-version'] = ['6.0.300'];
inputs['dotnet-version'] = ['10.0.101'];
inputs['dotnet-quality'] = '';
inputs['cache'] = false;
@@ -209,7 +209,7 @@ describe('setup-dotnet tests', () => {
});
it(`shouldn't call restoreCache() if cache feature isn't available`, async () => {
inputs['dotnet-version'] = ['6.0.300'];
inputs['dotnet-version'] = ['10.0.101'];
inputs['dotnet-quality'] = '';
inputs['cache'] = true;

View File

@@ -73,6 +73,7 @@ $targetFrameworkVersionMap = @{
"7.0" = "net7.0";
"8.0" = "net8.0";
"9.0" = "net9.0";
"10.0" = "net10.0";
}
foreach ($version in $Versions)