Step two of swapping over to check enforcer type ci (#3159)

Step 2 of https://github.com/microsoft/typespec/issues/3117
This commit is contained in:
m-nash 2024-04-11 16:15:27 -07:00 коммит произвёл GitHub
Родитель 75fcae981b
Коммит 39138d72e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 87 добавлений и 192 удалений

Просмотреть файл

@ -23,8 +23,6 @@ extends:
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
@ -35,73 +33,7 @@ extends:
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
- template: /eng/tsp-core/pipelines/stages/ci-stages.yml
parameters:
DependsOn: InitStage
Condition: eq('true', stageDependencies.InitStage.outputs['InitJob.InitStep.RunCore'])

Просмотреть файл

@ -22,8 +22,8 @@ parameters:
type: stepList
default: []
# String to add to the end of stage names.
- name: StageSuffix
# String to add to the beginning of stage names.
- name: StagePrefix
type: string
# List of packages to publish. Each package is an object with the following properties:
@ -69,8 +69,8 @@ stages:
# 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 }}
- stage: ${{ parameters.StagePrefix }}_Build
displayName: ${{ parameters.StagePrefix }} - Build
condition: and(succeeded(), ${{ parameters.Condition }})
dependsOn: ${{ parameters.DependsOn }}
variables:
@ -124,14 +124,14 @@ stages:
# 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 }}
- stage: ${{ parameters.StagePrefix }}_Publish
displayName: ${{ parameters.StagePrefix }} - Publish
condition: and(succeeded(), ${{ parameters.Condition }})
dependsOn:
- ${{ parameters.DependsOn }}
- Build_${{ parameters.StageSuffix }}
- ${{ parameters.StagePrefix }}_Build
- ${{ if and(parameters.PublishDependsOnTest, ne(length(parameters.TestMatrix), 0)) }}:
- Test_${{ parameters.StageSuffix }}
- ${{ parameters.StagePrefix }}_Test
variables:
toolsRepositoryPath: $(Build.SourcesDirectory)
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts
@ -181,12 +181,12 @@ stages:
# 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 }}
- stage: ${{ parameters.StagePrefix }}_Test
displayName: ${{ parameters.StagePrefix }} - Test
condition: and(succeeded(), ${{ parameters.Condition }})
dependsOn:
- ${{ parameters.DependsOn }}
- Build_${{ parameters.StageSuffix }}
- ${{ parameters.StagePrefix }}_Build
variables:
selfRepositoryPath: $(Build.SourcesDirectory)
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts

Просмотреть файл

@ -1,91 +0,0 @@
trigger:
branches:
include:
- main
- gh-readonly-queue/* # Used to trigger for GitHub merge queues
# Not doing this until check enforcer is added https://github.com/microsoft/typespec/issues/3117
# paths:
# exclude:
# - packages/http-client-csharp
pr:
branches:
include:
- main
- release/*
# Not doing this until check enforcer is added https://github.com/microsoft/typespec/issues/3117
# paths:
# exclude:
# - packages/http-client-csharp
extends:
template: /eng/common/pipelines/templates/1es-redirect.yml
parameters:
variables:
- template: /eng/tsp-core/pipelines/templates/variables/globals.yml@self
stages:
- stage: CI
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

Просмотреть файл

@ -0,0 +1,71 @@
stages:
- stage: Build_Core
displayName: Core - Build
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

Просмотреть файл

@ -1,17 +0,0 @@
trigger: none
pr:
branches:
include:
- main
paths:
include:
- packages/http-client-csharp/
- eng/emitters/
- eng/common/
extends:
template: /eng/common/pipelines/templates/1es-redirect.yml
parameters:
stages:
- template: /packages/http-client-csharp/eng/pipeline/templates/ci-stages.yml

Просмотреть файл

@ -9,7 +9,7 @@ parameters:
stages:
- template: /eng/emitters/pipelines/templates/stages/emitter-stages.yml
parameters:
StageSuffix: csharp
StagePrefix: CSharp
BuildPrereleaseVersion: true
UseTypeSpecNext: false
Publish: "none"