Update to have a conditional pipeline so we only run what is needed based on the pr (#3150)
First step of https://github.com/microsoft/typespec/issues/3117 We will need to do the following after merge detailed in the above issue - update typespec - core - ci to point at the new `eng/common/pipelines/ci.yml` - move tsp-core steps into a template inside `eng/tsp-core/pipelines/templates` so that these can be changed independently - remove `eng/tsp-core/pipelines/ci.yml - remove `packages/http-client-csharp/eng/pipelies/ci.yml` --------- Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>
This commit is contained in:
Родитель
8888b38362
Коммит
75fcae981b
|
@ -0,0 +1,107 @@
|
|||
trigger: none
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
|
||||
extends:
|
||||
template: /eng/common/pipelines/templates/1es-redirect.yml
|
||||
parameters:
|
||||
stages:
|
||||
- stage: InitStage
|
||||
displayName: Initialize
|
||||
pool:
|
||||
name: $(LINUXPOOL)
|
||||
image: $(LINUXVMIMAGE)
|
||||
os: linux
|
||||
jobs:
|
||||
- job: InitJob
|
||||
displayName: Initialize
|
||||
steps:
|
||||
- pwsh: |
|
||||
Write-Host "Setting RunCore to true"
|
||||
Write-Host "##vso[task.setvariable variable=RunCore;isOutput=true]true"
|
||||
Write-Host "Setting RunCSharp to true"
|
||||
Write-Host "##vso[task.setvariable variable=RunCSharp;isOutput=true]true"
|
||||
Write-Host "Setting RunPython to true"
|
||||
Write-Host "##vso[task.setvariable variable=RunPython;isOutput=true]true"
|
||||
name: InitStep
|
||||
displayName: Initialize
|
||||
|
||||
# Run csharp stages if RunCSharp == true
|
||||
- template: /packages/http-client-csharp/eng/pipeline/templates/ci-stages.yml
|
||||
parameters:
|
||||
DependsOn: InitStage
|
||||
Condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunCSharp'])
|
||||
|
||||
# Run core stages if RunCore == true
|
||||
- stage: Build_Core
|
||||
displayName: Build Core
|
||||
dependsOn: InitStage
|
||||
condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunCore'])
|
||||
variables:
|
||||
- template: /eng/tsp-core/pipelines/templates/variables/globals.yml@self
|
||||
jobs:
|
||||
- job: windows
|
||||
displayName: Windows
|
||||
|
||||
variables:
|
||||
TYPESPEC_VS_CI_BUILD: true # Enable official Visual Studio extension build
|
||||
TYPESPEC_SKIP_DOCUSAURUS_BUILD: true # Disable docusaurus build
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
"Node 18.x":
|
||||
nodeVersion: 18.x
|
||||
|
||||
"Node 20.x":
|
||||
nodeVersion: 20.x
|
||||
|
||||
pool:
|
||||
name: $(WINDOWSPOOL)
|
||||
image: $(WINDOWSVMIMAGE)
|
||||
os: windows
|
||||
|
||||
steps:
|
||||
- template: /eng/tsp-core/pipelines/jobs/build-and-test.yml
|
||||
parameters:
|
||||
nodeVersion: $(nodeVersion)
|
||||
os: linux
|
||||
|
||||
- job: linux
|
||||
displayName: Linux
|
||||
|
||||
variables:
|
||||
TYPESPEC_VS_CI_BUILD: true # Enable official Visual Studio extension build
|
||||
TYPESPEC_SKIP_DOCUSAURUS_BUILD: true # Disable docusaurus build
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
"Node 18.x":
|
||||
nodeVersion: 18.x
|
||||
|
||||
"Node 20.x":
|
||||
nodeVersion: 20.x
|
||||
|
||||
pool:
|
||||
name: $(LINUXPOOL)
|
||||
image: $(LINUXVMIMAGE)
|
||||
os: linux
|
||||
|
||||
steps:
|
||||
- template: /eng/tsp-core/pipelines/jobs/build-and-test.yml
|
||||
parameters:
|
||||
nodeVersion: $(nodeVersion)
|
||||
os: linux
|
||||
|
||||
- template: /eng/tsp-core/pipelines/jobs/publish-artifacts.yml
|
||||
- template: /eng/tsp-core/pipelines/jobs/e2e.yml
|
||||
|
||||
- job: docker_build
|
||||
pool:
|
||||
name: $(LINUXPOOL)
|
||||
image: $(LINUXVMIMAGE)
|
||||
os: linux
|
||||
steps:
|
||||
- script: docker build -f ./docker/Dockerfile .
|
||||
displayName: Docker build
|
|
@ -64,152 +64,15 @@ extends:
|
|||
Use1ESOfficial: ${{ parameters.Use1ESOfficial }}
|
||||
BinSkimSettings: ${{ parameters.BinSkimSettings }}
|
||||
stages:
|
||||
# Build stage
|
||||
# Responsible for building the autorest generator and typespec emitter packages
|
||||
# Produces the artifact `build_artifacts` which contains the following:
|
||||
# emitter-package.json: Will be used to generate the emitter-package-lock.json file and placed in the `/eng` folder
|
||||
# of the sdk repository.
|
||||
# overrides.json: Contains npm package version overrides for the emitter and generator
|
||||
# packages/: Contains the packages to publish
|
||||
- stage: Build
|
||||
variables:
|
||||
selfRepositoryPath: $(Build.SourcesDirectory)
|
||||
jobs:
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 20.x
|
||||
Os: linux
|
||||
EmitArtifacts: true # Emit artifacts only for the first job
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 18.x
|
||||
Os: linux
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 20.x
|
||||
Os: windows
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 18.x
|
||||
Os: windows
|
||||
|
||||
# Publish stage
|
||||
# Responsible for publishing the packages in `build_artifacts/packages` and producing `emitter-package-lock.json`
|
||||
# Produces the artifact `publish_artifacts` which contains the following:
|
||||
# emitter-package-lock.json: Created by calling `npm install` using `build_artifacts/emitter-package.json` and will
|
||||
# be placed in the `/eng` folder of the sdk repository.
|
||||
- ${{ if ne(parameters.Publish, 'none') }}:
|
||||
- stage: Publish
|
||||
dependsOn:
|
||||
- Build
|
||||
- ${{ if and(parameters.PublishDependsOnTest, ne(length(parameters.TestMatrix), 0)) }}:
|
||||
- Test
|
||||
variables:
|
||||
toolsRepositoryPath: $(Build.SourcesDirectory)
|
||||
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts
|
||||
pool:
|
||||
name: $(LINUXPOOL)
|
||||
image: $(LINUXVMIMAGE)
|
||||
os: linux
|
||||
jobs:
|
||||
- job: Publish
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- download: current
|
||||
artifact: build_artifacts
|
||||
displayName: Download build artifacts
|
||||
|
||||
# Create authenticated .npmrc file for publishing
|
||||
- ${{ if eq(parameters.Publish, 'internal') }}:
|
||||
- template: /eng/emitters/pipelines/templates/steps/create-authenticated-npmrc.yml
|
||||
parameters:
|
||||
npmrcPath: $(buildArtifactsPath)/packages/.npmrc
|
||||
registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/
|
||||
- ${{ else }}:
|
||||
- pwsh: |
|
||||
"//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" | Out-File '.npmrc'
|
||||
displayName: Authenticate .npmrc for npmjs.org
|
||||
workingDirectory: $(buildArtifactsPath)/packages
|
||||
|
||||
# per package, publishing using appropriate tool
|
||||
- ${{ each package in parameters.Packages }}:
|
||||
- ${{ if eq(package.type, 'npm') }}:
|
||||
- pwsh: |
|
||||
$file = Resolve-Path "${{ package.file }}"
|
||||
Write-Host "npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages"
|
||||
npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages
|
||||
displayName: Publish ${{ package.name }}
|
||||
workingDirectory: $(buildArtifactsPath)/packages
|
||||
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
artifact: publish_artifacts
|
||||
|
||||
# Test stage
|
||||
# Responsible for running unit and functional tests using a matrix passed in as the parameter `TestMatrix`.
|
||||
# Will only run if the parameter `TestMatrix` is not empty.
|
||||
# The contents of the artifact `build_artifacts` are available under the path `$(buildArtifactsPath)`.
|
||||
- ${{ if or(parameters.UnitTestArgs, ne(length(parameters.TestMatrix), 0)) }}:
|
||||
- stage: Test
|
||||
dependsOn: Build
|
||||
variables:
|
||||
selfRepositoryPath: $(Build.SourcesDirectory)
|
||||
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts
|
||||
jobs:
|
||||
- ${{ if parameters.UnitTestArgs }}:
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 20.x
|
||||
Os: linux
|
||||
EmitArtifacts: true # Emit artifacts only for the first job
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 18.x
|
||||
Os: linux
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 20.x
|
||||
Os: windows
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 18.x
|
||||
Os: windows
|
||||
- tempate: /eng/emitters/pipelines/templates/stages/emitter-stages.yml
|
||||
parameters:
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
EmitterPackageJsonPath: ${{ parameters.EmitterPackageJsonPath }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
TestMatrix: ${{ parameters.TestMatrix }}
|
||||
PublishDependsOnTest: ${{ parameters.PublishDependsOnTest }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
|
|
|
@ -0,0 +1,223 @@
|
|||
parameters:
|
||||
# Whether to build alpha versions of the packages. This is passed as a flag to the build script.
|
||||
- name: BuildPrereleaseVersion
|
||||
type: boolean
|
||||
|
||||
# Whether to use the `next` version of TypeSpec. This is passed as a flag to the initialize script.
|
||||
- name: UseTypeSpecNext
|
||||
type: boolean
|
||||
|
||||
# Whether to publish to the internal feed.
|
||||
- name: Publish
|
||||
type: string
|
||||
default: "none"
|
||||
|
||||
# Path to the emitter package's package.json file. If specified, it will be used to generate emitter-package.json in the artifact `build_artifacts`.
|
||||
- name: EmitterPackageJsonPath
|
||||
type: string
|
||||
default: "not-specified"
|
||||
|
||||
# Custom steps to run in the Build and Test stages after the repositories are cloned.
|
||||
- name: AdditionalInitializeSteps
|
||||
type: stepList
|
||||
default: []
|
||||
|
||||
# String to add to the end of stage names.
|
||||
- name: StageSuffix
|
||||
type: string
|
||||
|
||||
# List of packages to publish. Each package is an object with the following properties:
|
||||
# name: The name of the package. This is used to determine the name of the file to publish.
|
||||
# type: The type of package. Currently supported values are 'npm' and 'nuget'.
|
||||
# file: The path to the file to publish. This is relative to the packages directory in the build artifacts directory.
|
||||
- name: Packages
|
||||
type: object
|
||||
default: []
|
||||
|
||||
# Arguments needed to run unit tests
|
||||
- name: UnitTestArgs
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
# Indicates the build matrix to use for post-build autorest validation
|
||||
- name: TestMatrix
|
||||
type: object
|
||||
default: {}
|
||||
|
||||
# Indicates the build matrix to use for post-build autorest validation
|
||||
- name: PublishDependsOnTest
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
# Location of emitter package path
|
||||
- name: PackagePath
|
||||
type: string
|
||||
|
||||
- name: Condition
|
||||
type: string
|
||||
default: true
|
||||
|
||||
- name: DependsOn
|
||||
type: object
|
||||
default: []
|
||||
|
||||
stages:
|
||||
# Build stage
|
||||
# Responsible for building the autorest generator and typespec emitter packages
|
||||
# Produces the artifact `build_artifacts` which contains the following:
|
||||
# emitter-package.json: Will be used to generate the emitter-package-lock.json file and placed in the `/eng` folder
|
||||
# of the sdk repository.
|
||||
# overrides.json: Contains npm package version overrides for the emitter and generator
|
||||
# packages/: Contains the packages to publish
|
||||
- stage: Build_${{ parameters.StageSuffix }}
|
||||
displayName: Build ${{ parameters.StageSuffix }}
|
||||
condition: and(succeeded(), ${{ parameters.Condition }})
|
||||
dependsOn: ${{ parameters.DependsOn }}
|
||||
variables:
|
||||
selfRepositoryPath: $(Build.SourcesDirectory)
|
||||
jobs:
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 20.x
|
||||
Os: linux
|
||||
EmitArtifacts: true # Emit artifacts only for the first job
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 18.x
|
||||
Os: linux
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 20.x
|
||||
Os: windows
|
||||
- template: /eng/emitters/pipelines/templates/jobs/build-job.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: ${{ parameters.BuildPrereleaseVersion }}
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: ${{ parameters.Publish }}
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
Packages: ${{ parameters.Packages }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
NodeVersion: 18.x
|
||||
Os: windows
|
||||
|
||||
# Publish stage
|
||||
# Responsible for publishing the packages in `build_artifacts/packages` and producing `emitter-package-lock.json`
|
||||
# Produces the artifact `publish_artifacts` which contains the following:
|
||||
# emitter-package-lock.json: Created by calling `npm install` using `build_artifacts/emitter-package.json` and will
|
||||
# be placed in the `/eng` folder of the sdk repository.
|
||||
- ${{ if ne(parameters.Publish, 'none') }}:
|
||||
- stage: Publish_${{ parameters.StageSuffix }}
|
||||
displayName: Publish ${{ parameters.StageSuffix }}
|
||||
condition: and(succeeded(), ${{ parameters.Condition }})
|
||||
dependsOn:
|
||||
- ${{ parameters.DependsOn }}
|
||||
- Build_${{ parameters.StageSuffix }}
|
||||
- ${{ if and(parameters.PublishDependsOnTest, ne(length(parameters.TestMatrix), 0)) }}:
|
||||
- Test_${{ parameters.StageSuffix }}
|
||||
variables:
|
||||
toolsRepositoryPath: $(Build.SourcesDirectory)
|
||||
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts
|
||||
pool:
|
||||
name: $(LINUXPOOL)
|
||||
image: $(LINUXVMIMAGE)
|
||||
os: linux
|
||||
jobs:
|
||||
- job: Publish
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- download: current
|
||||
artifact: build_artifacts
|
||||
displayName: Download build artifacts
|
||||
|
||||
# Create authenticated .npmrc file for publishing
|
||||
- ${{ if eq(parameters.Publish, 'internal') }}:
|
||||
- template: /eng/emitters/pipelines/templates/steps/create-authenticated-npmrc.yml
|
||||
parameters:
|
||||
npmrcPath: $(buildArtifactsPath)/packages/.npmrc
|
||||
registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/
|
||||
- ${{ else }}:
|
||||
- pwsh: |
|
||||
"//registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)" | Out-File '.npmrc'
|
||||
displayName: Authenticate .npmrc for npmjs.org
|
||||
workingDirectory: $(buildArtifactsPath)/packages
|
||||
|
||||
# per package, publishing using appropriate tool
|
||||
- ${{ each package in parameters.Packages }}:
|
||||
- ${{ if eq(package.type, 'npm') }}:
|
||||
- pwsh: |
|
||||
$file = Resolve-Path "${{ package.file }}"
|
||||
Write-Host "npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages"
|
||||
npm publish $file --verbose --access public --prefix $(buildArtifactsPath)/packages
|
||||
displayName: Publish ${{ package.name }}
|
||||
workingDirectory: $(buildArtifactsPath)/packages
|
||||
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
artifact: publish_artifacts
|
||||
|
||||
# Test stage
|
||||
# Responsible for running unit and functional tests using a matrix passed in as the parameter `TestMatrix`.
|
||||
# Will only run if the parameter `TestMatrix` is not empty.
|
||||
# The contents of the artifact `build_artifacts` are available under the path `$(buildArtifactsPath)`.
|
||||
- ${{ if or(parameters.UnitTestArgs, ne(length(parameters.TestMatrix), 0)) }}:
|
||||
- stage: Test_${{ parameters.StageSuffix }}
|
||||
displayName: Test ${{ parameters.StageSuffix }}
|
||||
condition: and(succeeded(), ${{ parameters.Condition }})
|
||||
dependsOn:
|
||||
- ${{ parameters.DependsOn }}
|
||||
- Build_${{ parameters.StageSuffix }}
|
||||
variables:
|
||||
selfRepositoryPath: $(Build.SourcesDirectory)
|
||||
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts
|
||||
jobs:
|
||||
- ${{ if parameters.UnitTestArgs }}:
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 20.x
|
||||
Os: linux
|
||||
EmitArtifacts: true # Emit artifacts only for the first job
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 18.x
|
||||
Os: linux
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 20.x
|
||||
Os: windows
|
||||
- template: /eng/emitters/pipelines/templates/jobs/test-job.yml
|
||||
parameters:
|
||||
AdditionalInitializeSteps: ${{ parameters.AdditionalInitializeSteps }}
|
||||
PackagePath: ${{ parameters.PackagePath }}
|
||||
UnitTestArgs: ${{ parameters.UnitTestArgs }}
|
||||
NodeVersion: 18.x
|
||||
Os: windows
|
|
@ -11,15 +11,7 @@ pr:
|
|||
- eng/common/
|
||||
|
||||
extends:
|
||||
template: /eng/emitters/pipelines/templates/archetype-emitter.yml
|
||||
template: /eng/common/pipelines/templates/1es-redirect.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: true
|
||||
UseTypeSpecNext: false
|
||||
Publish: "none"
|
||||
PackagePath: /packages/http-client-csharp
|
||||
EmitterPackageJsonPath: packages/http-client-csharp/package.json
|
||||
Packages:
|
||||
- name: emitter
|
||||
file: typespec-http-client-csharp-*.tgz
|
||||
type: npm
|
||||
UnitTestArgs: -UnitTests
|
||||
stages:
|
||||
- template: /packages/http-client-csharp/eng/pipeline/templates/ci-stages.yml
|
||||
|
|
|
@ -12,21 +12,25 @@ parameters:
|
|||
default: true
|
||||
|
||||
extends:
|
||||
template: /eng/emitters/pipelines/templates/archetype-emitter.yml
|
||||
template: /eng/common/pipelines/templates/1es-redirect.yml
|
||||
|
||||
parameters:
|
||||
BuildPrereleaseVersion: true
|
||||
${{ if eq(variables['Build.Reason'], 'Schedule') }}:
|
||||
# In scheduled builds, we always use the "next" version of TypeSpec
|
||||
UseTypeSpecNext: true
|
||||
${{ else }}:
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: "internal"
|
||||
PublishDependsOnTest: false
|
||||
PackagePath: /packages/http-client-csharp
|
||||
EmitterPackageJsonPath: packages/http-client-csharp/package.json
|
||||
Packages:
|
||||
- name: emitter
|
||||
file: typespec-http-client-csharp-*.tgz
|
||||
type: npm
|
||||
${{ if eq(parameters.RunUnitTests, true) }}:
|
||||
UnitTestArgs: -UnitTests
|
||||
stages:
|
||||
- tempate: /eng/emitters/pipelines/templates/stages/emitter-stages.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: true
|
||||
${{ if eq(variables['Build.Reason'], 'Schedule') }}:
|
||||
# In scheduled builds, we always use the "next" version of TypeSpec
|
||||
UseTypeSpecNext: true
|
||||
${{ else }}:
|
||||
UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }}
|
||||
Publish: "internal"
|
||||
PublishDependsOnTest: false
|
||||
PackagePath: /packages/http-client-csharp
|
||||
EmitterPackageJsonPath: packages/http-client-csharp/package.json
|
||||
Packages:
|
||||
- name: emitter
|
||||
file: typespec-http-client-csharp-*.tgz
|
||||
type: npm
|
||||
${{ if eq(parameters.RunUnitTests, true) }}:
|
||||
UnitTestArgs: -UnitTests
|
||||
|
|
|
@ -9,16 +9,20 @@ trigger:
|
|||
pr: none
|
||||
|
||||
extends:
|
||||
template: /eng/emitters/pipelines/templates/archetype-emitter.yml
|
||||
template: /eng/common/pipelines/templates/1es-redirect.yml
|
||||
|
||||
parameters:
|
||||
BuildPrereleaseVersion: false
|
||||
UseTypeSpecNext: false
|
||||
Publish: "internal"
|
||||
PublishDependsOnTest: true
|
||||
PackagePath: /packages/http-client-csharp
|
||||
EmitterPackageJsonPath: packages/http-client-csharp/package.json
|
||||
Packages:
|
||||
- name: emitter
|
||||
file: typespec-http-client-csharp-*.tgz
|
||||
type: npm
|
||||
UnitTestArgs: -UnitTests
|
||||
stages:
|
||||
- tempate: /eng/emitters/pipelines/templates/stages/emitter-stages.yml
|
||||
parameters:
|
||||
BuildPrereleaseVersion: false
|
||||
UseTypeSpecNext: false
|
||||
Publish: "internal"
|
||||
PublishDependsOnTest: true
|
||||
PackagePath: /packages/http-client-csharp
|
||||
EmitterPackageJsonPath: packages/http-client-csharp/package.json
|
||||
Packages:
|
||||
- name: emitter
|
||||
file: typespec-http-client-csharp-*.tgz
|
||||
type: npm
|
||||
UnitTestArgs: -UnitTests
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
parameters:
|
||||
- name: Condition
|
||||
type: string
|
||||
default: true
|
||||
- name: DependsOn
|
||||
type: object
|
||||
default: []
|
||||
|
||||
stages:
|
||||
- template: /eng/emitters/pipelines/templates/stages/emitter-stages.yml
|
||||
parameters:
|
||||
StageSuffix: csharp
|
||||
BuildPrereleaseVersion: true
|
||||
UseTypeSpecNext: false
|
||||
Publish: "none"
|
||||
PackagePath: /packages/http-client-csharp
|
||||
EmitterPackageJsonPath: packages/http-client-csharp/package.json
|
||||
Packages:
|
||||
- name: emitter
|
||||
file: typespec-http-client-csharp-*.tgz
|
||||
type: npm
|
||||
UnitTestArgs: -UnitTests
|
||||
Condition: ${{ parameters.Condition }}
|
||||
DependsOn: ${{ parameters.DependsOn }}
|
Загрузка…
Ссылка в новой задаче