Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/basic-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Check dist/

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: CodeQL analysis

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 3 * * 0'

Expand Down
103 changes: 100 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'

Expand Down Expand Up @@ -257,6 +254,106 @@ jobs:
shell: pwsh
run: __tests__/verify-dotnet.ps1 -Patterns "^9.0", "^10.0"

test-setup-global-json-rollforward-latestmajor:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-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": "3.1.0","rollForward": "latestMajor"}}' > ./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 "^(?!3)"

test-setup-global-json-rollforward-latestminor:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clear toolcache
shell: pwsh
run: __tests__/clear-toolcache.ps1 ${{ runner.os }}
- name: Write global.json
shell: bash
run: |
mkdir subdirectory
echo '{"sdk":{"version": "3.0.100","rollForward": "latestMinor"}}' > ./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 "^3.1"

test-setup-global-json-rollforward-latestfeature:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- 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.100","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.4"

test-setup-global-json-rollforward-latestpatch:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- 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.400","rollForward": "latestPatch"}}' > ./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.428$"

test-setup-global-json-only:
runs-on: ${{ matrix.operating-system }}
strategy:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/licensed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ name: Licensed

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'

Expand Down
4 changes: 2 additions & 2 deletions __tests__/clear-toolcache.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ $dotnetPaths = @{

foreach ($srcPath in $dotnetPaths[$args[0]]) {
if (Test-Path $srcPath) {
Write-Host "Move $srcPath path"
$dstPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
$dstPath = "$srcPath-" + [IO.Path]::GetRandomFileName()
Write-Host "Moving $srcPath to $dstPath"
Move-Item -Path $srcPath -Destination $dstPath
}
}
4 changes: 0 additions & 4 deletions __tests__/e2e-test-csproj/AssemblyInfo.cs

This file was deleted.

12 changes: 3 additions & 9 deletions __tests__/e2e-test-csproj/Test.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace test_csproj
{
[TestClass]
public class Test
public static class Program
{
[TestMethod]
public void TestMethod()
public static void Main()
{
Console.WriteLine("TestMethod");
int calculatedResult = 1000 / 25;
int expectedResult = 40;
Assert.AreEqual(expectedResult, calculatedResult);
Console.WriteLine("Test");
}
}
}
113 changes: 4 additions & 109 deletions __tests__/e2e-test-csproj/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,116 +2,11 @@
"version": 1,
"dependencies": {
"net10.0": {
"Microsoft.NET.Test.Sdk": {
"type": "Direct",
"requested": "[18.0.1, )",
"resolved": "18.0.1",
"contentHash": "WNpu6vI2rA0pXY4r7NKxCN16XRWl5uHu6qjuyVLoDo6oYEggIQefrMjkRuibQHm/NslIUNCcKftvoWAN80MSAg==",
"dependencies": {
"Microsoft.CodeCoverage": "18.0.1",
"Microsoft.TestPlatform.TestHost": "18.0.1"
}
},
"MSTest.TestAdapter": {
"type": "Direct",
"requested": "[4.0.2, )",
"resolved": "4.0.2",
"contentHash": "AHyUqtL2GUB5Of0LRvYtz1DvNHIP7KBItI1uX4Cfvgv3Vbdc1ZaCGCN2Zac/bz0S8pQpmnf7xn5K4zrL25NERg==",
"dependencies": {
"MSTest.TestFramework": "4.0.2",
"Microsoft.Testing.Extensions.VSTestBridge": "2.0.2",
"Microsoft.Testing.Platform.MSBuild": "2.0.2"
}
},
"MSTest.TestFramework": {
"type": "Direct",
"requested": "[4.0.2, )",
"resolved": "4.0.2",
"contentHash": "ANLNvVh13tfi4ou0Xu0bZ5J83brlLufxMVVp1feUm99cWtfEn8i8PH4kskD0HSp1bFl8goZiHoCwd+fu/0L2hA==",
"dependencies": {
"MSTest.Analyzers": "4.0.2"
}
},
"Microsoft.ApplicationInsights": {
"type": "Transitive",
"resolved": "2.23.0",
"contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw=="
},
"Microsoft.CodeCoverage": {
"type": "Transitive",
"resolved": "18.0.1",
"contentHash": "O+utSr97NAJowIQT/OVp3Lh9QgW/wALVTP4RG1m2AfFP4IyJmJz0ZBmFJUsRQiAPgq6IRC0t8AAzsiPIsaUDEA=="
},
"Microsoft.Testing.Extensions.Telemetry": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "H580BvHyuADoWzlH9zRk5fqVyGucm6mhph+k40CQc9O4ie+Buxa4Pk9Q92BEClqIICqi25J7fuMII9qFYYgKtw==",
"dependencies": {
"Microsoft.ApplicationInsights": "2.23.0",
"Microsoft.Testing.Platform": "2.0.2"
}
},
"Microsoft.Testing.Extensions.TrxReport.Abstractions": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "MrHYdPZ1CiyYp5bfjzNSghfVwl/I9osMazcZMAbwZY0BhR32i70YLf4zSXECvU2qt2PvDdrjYpGRgBscFbjDpw==",
"dependencies": {
"Microsoft.Testing.Platform": "2.0.2"
}
},
"Microsoft.Testing.Extensions.VSTestBridge": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "6WSUZyv71NmF1bhFWpNht2bskVWL/5Lcu9qxDUnnboYRiujh9w4swn/cPSbVCSGXwyMq9uKRlI9zZ+ReBO8e+Q==",
"dependencies": {
"Microsoft.TestPlatform.AdapterUtilities": "18.0.1",
"Microsoft.TestPlatform.ObjectModel": "18.0.1",
"Microsoft.Testing.Extensions.Telemetry": "2.0.2",
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "2.0.2",
"Microsoft.Testing.Platform": "2.0.2"
}
},
"Microsoft.Testing.Platform": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "43NCOTEENtdc9fmlzX9KHQR14AZEYek5r4jOJlWPhTyV1+aYAQYl4x773nYXU5TKxV6+rMuniJ7wcj9C9qrP1A=="
},
"Microsoft.Testing.Platform.MSBuild": {
"type": "Transitive",
"resolved": "2.0.2",
"contentHash": "2zKkQKaUoaKgb/3AekboWOdLMh4upCo1nLWQnjGzp8r9YjiNOZRrzTsJQ3A4U03AcbH0evlIvFDKYSUqmTVuug==",
"dependencies": {
"Microsoft.Testing.Platform": "2.0.2"
}
},
"Microsoft.TestPlatform.AdapterUtilities": {
"type": "Transitive",
"resolved": "18.0.1",
"contentHash": "gXIugDKnACB8p93+9dFnMdE7vvs0ZrjjDltdGC4VylbKK7gPegWYASGjryVkIDvFr56Ulx4UDIKsB71qYHJBWg=="
},
"Microsoft.TestPlatform.ObjectModel": {
"type": "Transitive",
"resolved": "18.0.1",
"contentHash": "qT/mwMcLF9BieRkzOBPL2qCopl8hQu6A1P7JWAoj/FMu5i9vds/7cjbJ/LLtaiwWevWLAeD5v5wjQJ/l6jvhWQ=="
},
"Microsoft.TestPlatform.TestHost": {
"type": "Transitive",
"resolved": "18.0.1",
"contentHash": "uDJKAEjFTaa2wHdWlfo6ektyoh+WD4/Eesrwb4FpBFKsLGehhACVnwwTI4qD3FrIlIEPlxdXg3SyrYRIcO+RRQ==",
"dependencies": {
"Microsoft.TestPlatform.ObjectModel": "18.0.1",
"Newtonsoft.Json": "13.0.3"
}
},
"MSTest.Analyzers": {
"type": "Transitive",
"resolved": "4.0.2",
"contentHash": "83PHm/97WR6XuciUicakLXSPDFubMsphUHxQHgkUfHcF8rOjpnlKSjRazhuvcGeqy2co8ZudUNbTM+u5e5Ujow=="
},
"Newtonsoft.Json": {
"type": "Transitive",
"resolved": "13.0.3",
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
"type": "Direct",
"requested": "[13.0.4, )",
"resolved": "13.0.4",
"contentHash": "pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A=="
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions __tests__/e2e-test-csproj/test.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(TEST_TARGET_FRAMEWORK)</TargetFramework>
<IsPackable>false</IsPackable>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>

<ItemGroup>
<!-- These packages will be downloaded over the network for testing proxy settings -->
<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" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion __tests__/verify-dotnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ foreach ($version in $Versions)
}

Write-Host "Testing compiled C# project with $version .NET version."
& $dotnet test --no-build
& $dotnet run --no-build
if ($LASTEXITCODE -ne 0)
{
throw "Testing process is not successful, exit code: $LASTEXITCODE"
Expand Down
20 changes: 17 additions & 3 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79246,9 +79246,23 @@ function getVersionFromGlobalJson(globalJsonPath) {
if (globalJson.sdk && globalJson.sdk.version) {
version = globalJson.sdk.version;
const rollForward = globalJson.sdk.rollForward;
if (rollForward && rollForward === 'latestFeature') {
const [major, minor] = version.split('.');
version = `${major}.${minor}`;
if (rollForward) {
const [major, minor, featurePatch] = version.split('.');
const feature = featurePatch.substring(0, 1);
switch (rollForward) {
case 'latestMajor':
version = '';
break;
case 'latestMinor':
version = `${major}`;
break;
case 'latestFeature':
version = `${major}.${minor}`;
break;
case 'latestPatch':
version = `${major}.${minor}.${feature}xx`;
break;
}
}
}
return version;
Expand Down
Loading