diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 99161fd02b6f..200e073bc7a4 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -1,56 +1,96 @@ jobs: - job: Build + variables: - template: ../variables/globals.yml + pool: vmImage: vs2017-win2016 + steps: + - task: DotNetCoreInstaller@2 displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" inputs: version: "$(DotNetCoreSDKVersion)" - - script: "dotnet pack ${{parameters.ProjectFile}} -o $(Build.ArtifactStagingDirectory) -warnaserror /p:PublicSign=false" - displayName: "Build and Package" + + - script: "dotnet build ${{parameters.ProjectFile}} -warnaserror /p:PublicSign=false" + displayName: "Build" env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_MULTILEVEL_LOOKUP: 0 + + - ${{ if eq(variables['Build.Reason'], 'PullRequest')}}: + - script: "dotnet pack ${{parameters.ProjectFile}} --no-build --version-suffix pr.$(Build.BuildID) -o $(Build.ArtifactStagingDirectory) -warnaserror /p:PublicSign=false" + displayName: "Package (ci.$(Build.BuildID))" + env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_MULTILEVEL_LOOKUP: 0 + + - ${{ if eq(variables['Build.Reason'], 'PullRequest')}}: + - script: "dotnet pack ${{parameters.ProjectFile}} --no-build --version-suffix ci.$(Build.BuildID) -o $(Build.ArtifactStagingDirectory) -warnaserror /p:PublicSign=false" + displayName: "Package (ci.$(Build.BuildID))" + env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_MULTILEVEL_LOOKUP: 0 + - script: "dotnet pack ${{parameters.ProjectFile}} --no-build -o $(Build.ArtifactStagingDirectory) -warnaserror /p:PublicSign=false" + displayName: "Package (no suffix)" + env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_MULTILEVEL_LOOKUP: 0 + - task: PublishPipelineArtifact@0 condition: succeededOrFailed() inputs: artifactName: packages targetPath: $(Build.ArtifactStagingDirectory) + - job: "Analyze" + variables: - template: ../variables/globals.yml + dependsOn: - Build + pool: vmImage: "vs2017-win2016" + steps: + - task: UsePythonVersion@0 displayName: "Use Python 3.6" inputs: versionSpec: "3.6" + - script: | pip install setuptools wheel pip install doc-warden ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/eng/.docsettings.yml displayName: "Verify Readmes" + - task: DownloadPipelineArtifact@1 displayName: "Download Build Artifacts" condition: and(succeededOrFailed(), ne(variables['Build.Reason'],'PullRequest')) inputs: artifactName: packages targetPath: $(System.DefaultWorkingDirectory) + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: "Component Detection" # ComponentGovernance is currently unable to run on pull requests of public projects. Running on # scheduled builds should be good enough. condition: and(succeededOrFailed(), ne(variables['Build.Reason'],'PullRequest')) + - job: "Test" + variables: - template: ../variables/globals.yml + strategy: maxParallel: $[ variables['MaxParallelTestJobs'] ] matrix: @@ -63,35 +103,42 @@ jobs: MacOs: OSName: "MacOS" OSVmImage: "macOS-10.13" + pool: vmImage: "$(OSVmImage)" + steps: - powershell: | Invoke-WebRequest -Uri "https://github.com/Azure/azure-sdk-tools/releases/download/sdk-tools_14793/sdk-tools.zip" ` -OutFile "sdk-tools.zip" | Wait-Process; Expand-Archive -Path "sdk-tools.zip" -DestinationPath "./sdk-tools/" workingDirectory: "$(Build.BinariesDirectory)" displayName: "Download Tools Archive From Github Release and Extract it" + - task: PythonScript@0 displayName: "Run VerifyAgentOS script" inputs: scriptPath: "$(Build.BinariesDirectory)/sdk-tools/scripts/python/verify_agent_os.py" arguments: $(OSName) + - task: DotNetCoreInstaller@2 displayName: "Use .NET Core runtime $(DotNetCoreRuntimeVersion)" inputs: packageType: runtime version: "$(DotNetCoreRuntimeVersion)" + - task: DotNetCoreInstaller@2 displayName: "Use .NET Core sdk $(DotNetCoreSDKVersion)" inputs: packageType: sdk version: "$(DotNetCoreSDKVersion)" + - script: "dotnet test ${{parameters.ProjectFile}} --filter TestCategory!=Live --logger trx" displayName: "Build & Test" env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_MULTILEVEL_LOOKUP: 0 + - task: PublishTestResults@2 condition: succeededOrFailed() inputs: diff --git a/eng/pipelines/templates/jobs/dummy.yml b/eng/pipelines/templates/jobs/dummy.yml new file mode 100644 index 000000000000..c785414e8b36 --- /dev/null +++ b/eng/pipelines/templates/jobs/dummy.yml @@ -0,0 +1,4 @@ +jobs: +- job: ${{parameters.Name}} + steps: + - script: echo Hello from ${{parameters.Name}}! \ No newline at end of file diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml new file mode 100644 index 000000000000..3befffc8abc2 --- /dev/null +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -0,0 +1,56 @@ +stages: +- stage: Build + displayName: Ring 0 / Build + jobs: + - template: ../jobs/archetype-sdk-client.yml + parameters: + ProjectFile: ${{parameters.ProjectFile}} +- stage: ExtendedValidation + dependsOn: Build + displayName: Ring 1 / Extended Validation + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder1 +- stage: LiveTesting + dependsOn: ExtendedValidation + displayName: Ring 2 / Live Testing + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder2 +- stage: PreviewPrep + dependsOn: LiveTesting + displayName: Ring 3 / Preview Preparation + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder3 +- stage: PreviewGoLive + dependsOn: PreviewPrep + displayName: Ring 4 / Preview Go-Live! + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder4 +- stage: Bake + dependsOn: PreviewGoLive + displayName: Ring 5 / Bake + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder5 +- stage: ReleasePrep + dependsOn: Bake + displayName: Ring 6 / Release Prep + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder6 +- stage: ReleaseGoLive + dependsOn: ReleasePrep + displayName: Ring 7 / Release Go Live! + jobs: + - template: ../jobs/dummy.yml + parameters: + Name: Placeholder7 \ No newline at end of file diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 188769bedfd3..c835767a5f02 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -19,7 +19,7 @@ pr: - sdk/core/ - eng/ -jobs: -- template: ../../eng/pipelines/templates/jobs/archetype-sdk-client.yml +stages: +- template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ProjectFile: sdk/core/Azure.Core/Azure.Core.sln \ No newline at end of file