-
Notifications
You must be signed in to change notification settings - Fork 317
[DRAFT] Use global.json to restrict .NET SDK use #3797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ffbded2
7d5298e
c83462d
9834c94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,11 +60,7 @@ jobs: | |
| - name: Setup .NET Core SDK | ||
| uses: actions/[email protected] | ||
| with: | ||
| # TODO: Update this to .NET 10 once PR #3686 is complete. | ||
| # TODO: Replace this with global-json-file once PR #3797 is complete. | ||
| dotnet-version: 9.x | ||
| dotnet-quality: ga | ||
| #global-json-file: global.json | ||
| global-json-file: global.json | ||
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,11 @@ parameters: | |
| # The timeout, in minutes, for this job. | ||
| - name: timeout | ||
| type: number | ||
|
|
||
| # True if this is an ARM64 job. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to detect ARM64 - we already know explicitly which agent images are ARM64 and we can simply set this flag in those cases. |
||
| - name: isArm64 | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| - job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }} | ||
|
|
@@ -102,6 +107,15 @@ jobs: | |
| value: '$(dotnetx86Path)' | ||
|
|
||
| steps: | ||
|
|
||
| # Install the .NET SDK and Runtimes. | ||
| - template: /eng/pipelines/steps/install-dotnet.yml@self | ||
| parameters: | ||
| ${{ if parameters.isArm64 }}: | ||
| architecture: arm64 | ||
| debug: ${{ parameters.debug }} | ||
| runtimes: ['8.0', '9.0'] | ||
|
|
||
| - ${{ if ne(parameters.prebuildSteps, '') }}: | ||
| - ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration | ||
|
|
||
|
|
@@ -121,6 +135,12 @@ jobs: | |
| } | ||
| displayName: 'Verify Password' | ||
|
|
||
| - ${{ if eq(parameters.buildType, 'Project') }}: | ||
| - template: ../steps/ci-project-build-step.yml@self | ||
| parameters: | ||
| build: allNoDocs | ||
| buildConfiguration: ${{ parameters.buildConfiguration }} | ||
|
|
||
| - ${{ if ne(parameters.configProperties, '{}') }}: | ||
| - template: ../steps/update-config-file-step.yml@self # update config.json file | ||
| parameters: | ||
|
|
@@ -253,33 +273,14 @@ jobs: | |
| # it should be acceptable to just install a specific version in all cases. | ||
| # @TODO: This setup is very confusing. Ideally we should just be utilizing the dotnet installation | ||
| # earlier in the job. There has to be a cleaner way of doing this. | ||
| # As it stands now, we install dotnet LTS if we're running netfx tests, and the appropriate netX | ||
| # version if we're running netcore tests. Technically LTS is not supported by the UseDotNet task | ||
| # but we know we're using install-dotnet since we're on windows (for now ... this will not work | ||
| # forever and needs a serious rethinking). | ||
| - ${{ if ne(variables['dotnetx86RootPath'], '') }}: | ||
| - ${{ if startswith(parameters.targetFramework, 'net4')}}: | ||
| - template: ../steps/ensure-dotnet-version.yml | ||
| parameters: | ||
| installDir: "$(dotnetx86RootPath)" | ||
| packageType: "sdk" | ||
| usePreview: "false" | ||
| version: "LTS" | ||
| windowsArchitecture: "x86" | ||
| - ${{ else }}: | ||
| - script: | | ||
| set FrameworkVersion=${{ parameters.targetFramework }} | ||
| echo %FrameworkVersion% | ||
| set TrimmedFrameworkVersion=%FrameworkVersion:~3% | ||
| echo %TrimmedFrameworkVersion% | ||
| echo ##vso[task.setvariable variable=netVersionX86]%TrimmedFrameworkVersion% | ||
| displayName: "Trim dotnet version" | ||
| - template: ../steps/ensure-dotnet-version.yml | ||
| parameters: | ||
| installDir: "$(dotnetx86RootPath)" | ||
| packageType: "sdk" | ||
| usePreview: "false" | ||
| version: $(netVersionX86) | ||
| # Install the .NET SDK and Runtimes for x86. | ||
| - template: /eng/pipelines/steps/install-dotnet.yml@self | ||
| parameters: | ||
| architecture: x86 | ||
| debug: ${{ parameters.debug }} | ||
| installDir: $(dotnetx86RootPath) | ||
| runtimes: ['8.0', '9.0'] | ||
|
|
||
paulmedynski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - template: ../steps/run-all-tests-step.yml@self | ||
| parameters: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,34 +25,19 @@ parameters: | |
| - MSS | ||
|
|
||
| steps: | ||
| - task: DownloadSecureFile@1 | ||
| displayName: 'Download Key Pair' | ||
| inputs: | ||
| secureFile: netfxKeypair.snk | ||
| retryCount: 5 | ||
|
|
||
| - task: UseDotNet@2 | ||
| displayName: 'Use .NET 10.x sdk' | ||
| inputs: | ||
| packageType: sdk | ||
| version: '10.x' | ||
|
|
||
| - task: UseDotNet@2 | ||
| displayName: 'Use .NET 9.x runtime' | ||
| inputs: | ||
| packageType: runtime | ||
| version: '9.x' | ||
| - task: DownloadSecureFile@1 | ||
| displayName: 'Download Key Pair' | ||
| inputs: | ||
| secureFile: netfxKeypair.snk | ||
| retryCount: 5 | ||
|
|
||
| - task: UseDotNet@2 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need a .NET 8 runtime to build things. We would only need it to run tests, which doesn't happen as part of this pipeline tree. |
||
| displayName: 'Install .NET 8.x runtime' | ||
| inputs: | ||
| packageType: runtime | ||
| version: '8.x' | ||
| # Install the .NET SDK. | ||
| - template: /eng/pipelines/steps/install-dotnet.yml@self | ||
|
|
||
| - ${{ if eq(parameters.product, 'MDS') }}: | ||
| - task: MSBuild@1 | ||
| displayName: 'BuildAllConfigurations using build.proj' | ||
| inputs: | ||
| solution: '**/build.proj' | ||
| configuration: '${{parameters.buildConfiguration }}' | ||
| msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAllConfigurations -p:GenerateNuget=false -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk' | ||
| - ${{ if eq(parameters.product, 'MDS') }}: | ||
| - task: MSBuild@1 | ||
| displayName: 'BuildAllConfigurations using build.proj' | ||
| inputs: | ||
| solution: '**/build.proj' | ||
| configuration: '${{parameters.buildConfiguration }}' | ||
| msbuildArguments: '-p:AssemblyFileVersion=${{parameters.AssemblyFileVersion }} -t:BuildAllConfigurations -p:GenerateNuget=false -p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,24 +25,6 @@ parameters: | |
| - Package | ||
|
|
||
| steps: | ||
| - template: ensure-dotnet-version.yml | ||
| parameters: | ||
| packageType: sdk | ||
| usePreview: false | ||
| version: 10.0 | ||
|
|
||
| - template: ensure-dotnet-version.yml | ||
| parameters: | ||
| packageType: runtime | ||
| usePreview: false | ||
| version: 9.0 | ||
|
|
||
| - template: ensure-dotnet-version.yml | ||
| parameters: | ||
| packageType: runtime | ||
| usePreview: false | ||
| version: 8.0 | ||
|
|
||
| - ${{if eq(parameters.debug, true)}}: | ||
| - powershell: | | ||
| Get-ChildItem env: | Sort-Object Name | ||
|
|
@@ -61,9 +43,3 @@ steps: | |
| parameters: | ||
| downloadedNugetPath: $(Pipeline.Workspace)\${{parameters.artifactName }} | ||
| debug: ${{ parameters.debug }} | ||
paulmedynski marked this conversation as resolved.
Show resolved
Hide resolved
paulmedynski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - ${{ else }}: # project | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was weird for the pre-build step to run a build. This has been moved out to the calling template, along with the installation of the SDKs and Runtimes. |
||
| - template: ci-project-build-step.yml@self | ||
| parameters: | ||
| build: allNoDocs | ||
| buildConfiguration: ${{ parameters.buildConfiguration }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,21 +37,6 @@ parameters: | |
| - allNoDocs | ||
|
|
||
| steps: | ||
paulmedynski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - template: ./ensure-dotnet-version.yml@self | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now happens earlier in the template tree. |
||
| parameters: | ||
| packageType: 'sdk' | ||
| version: '10.0' | ||
|
|
||
| - template: ./ensure-dotnet-version.yml@self | ||
| parameters: | ||
| packageType: 'runtime' | ||
| version: '9.0' | ||
|
|
||
| - template: ./ensure-dotnet-version.yml@self | ||
| parameters: | ||
| packageType: 'runtime' | ||
| version: '8.0' | ||
|
|
||
| - ${{ if or(eq(parameters.operatingSystem, 'Windows'), eq(parameters.operatingSystem, 'deferedToRuntime')) }}: | ||
| - ${{ if or(eq(parameters.build, 'MDS'), eq(parameters.build, 'all'), eq(parameters.build, 'allNoDocs')) }}: | ||
| - task: MSBuild@1 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.