Skip to content

Commit

Permalink
Updated CI (#171)
Browse files Browse the repository at this point in the history
* Updated CI

* Use ubuntu-20.04 because of pre-installed .NET SDKs

* Use ComPlus_ prefix for env-variables and not DOTNET_ (is available for .NET 6 onwards)

* Allow ci-docs.yml to run even on PRs when triggered
  • Loading branch information
gfoidl authored Sep 30, 2022
1 parent b7b6ddf commit b2e332b
Show file tree
Hide file tree
Showing 21 changed files with 208 additions and 149 deletions.
41 changes: 41 additions & 0 deletions .azure/pipelines/ci-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
variables:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CI_BUILD_NUMBER: $(Build.BuildId)
BRANCH_NAME: $(Build.SourceBranchName)
TAG_NAME: $(Build.SourceBranchName)

trigger: none
# pr trigger must not be excluded, but in the UI for the pipeline definition a setting has to be made.
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers
# for further info.

schedules:
- cron: "0 0 * * *"
displayName: "Daily midnight build"
branches:
include:
- master

stages:
- stage: Benchmarks
jobs:
- template: jobs/benchmarks.yml
parameters:
name: benchmarks_windows
vmImage: 'windows-2022'

- template: jobs/benchmarks.yml
parameters:
name: benchmarks_linux
vmImage: 'ubuntu-20.04'

- template: jobs/benchmarks.yml
parameters:
name: benchmarks_mac
vmImage: 'macOS-12'

- template: jobs/benchmarks_net_full.yml
parameters:
name: benchmarks_net_full
vmImage: 'windows-2022'
27 changes: 27 additions & 0 deletions .azure/pipelines/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
variables:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CI_BUILD_NUMBER: $(Build.BuildId)
BRANCH_NAME: $(Build.SourceBranchName)
TAG_NAME: $(Build.SourceBranchName)

# We don't need a CI trigger here, as the pipeline trigger starts this pipeline for master anyway.
trigger: none

resources:
pipelines:
- pipeline: ci-build
source: Base64
trigger: true

stages:
- stage: Build_Docs
jobs:
- template: jobs/build_docs.yml

- stage: Deploy
dependsOn:
- Build_Docs
condition: and( succeeded(), startsWith( variables['Build.SourceBranch'], 'refs/tags' ) )
jobs:
- template: jobs/deploy_docs.yml
13 changes: 5 additions & 8 deletions .azure/pipelines/fuzz.yml → .azure/pipelines/ci-fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CI_BUILD_NUMBER: $(Build.BuildId)
BRANCH_NAME: $(Build.SourceBranchName)
TAG_NAME: $(Build.SourceBranchName)
#SDK_VERSION: 3.x

trigger:
branches:
exclude:
- '*'

pr: none
trigger: none
# pr trigger must not be excluded, but in the UI for the pipeline definition a setting has to be made.
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers
# for further info.

schedules:
- cron: "0 12 * * 0"
Expand Down
90 changes: 22 additions & 68 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
@@ -1,128 +1,82 @@
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CI_BUILD_NUMBER: $(Build.BuildId)
BRANCH_NAME: $(Build.SourceBranchName)
TAG_NAME: $(Build.SourceBranchName)
#SDK_VERSION: 3.x

trigger:
- master
- ci-*
- refs/tags/v*

pr:
branches:
include:
- master

schedules:
- cron: "0 0 * * *"
displayName: "Daily midnight build"
branches:
include:
- master

stages:
- stage: Build_Test_Windows
jobs:
- template: jobs/build_and_test.yml
parameters:
name: windows
vmImage: 'windows-2019'
vmImage: 'windows-2022'

- stage: Build_Test_Linux
dependsOn: [] # break sequential dependency
jobs:
- template: jobs/build_and_test.yml
parameters:
name: linux
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'

- template: jobs/build_and_test_intrinsics.yml
parameters:
name: intrinsics
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'

- stage: Build_Test_MacOS
dependsOn: [] # break sequential dependency
jobs:
- template: jobs/build_and_test.yml
parameters:
name: mac
vmImage: 'macOS-10.15'
vmImage: 'macOS-12'

- stage: Code_Coverage
- stage: Demo
dependsOn:
- Build_Test_Windows
- Build_Test_Linux
- Build_Test_MacOS
jobs:
- template: jobs/coverage.yml
- template: jobs/demo.yml
parameters:
name: demo_windows
vmImage: 'windows-2022'

- template: jobs/demo.yml
parameters:
name: demo_linux
vmImage: 'ubuntu-20.04'

- template: jobs/demo.yml
parameters:
name: demo_mac
vmImage: 'macOS-12'

- stage: Build_Docs
- stage: Code_Coverage
dependsOn:
- Build_Test_Windows
- Build_Test_Linux
- Build_Test_MacOS
jobs:
- template: jobs/build_docs.yml
- template: jobs/coverage.yml

- stage: Deploy
dependsOn:
- Build_Test_Windows
- Build_Test_Linux
- Build_Test_MacOS
- Build_Docs
condition: and( succeeded(), startsWith( variables['Build.SourceBranch'], 'refs/tags' ) )
jobs:
- template: jobs/deploy_nuget.yml
- template: jobs/deploy_docs.yml

- stage: Benchmarks
dependsOn:
- Build_Test_Windows
- Build_Test_Linux
- Build_Test_MacOS
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'Schedule'))
jobs:
- template: jobs/benchmarks.yml
parameters:
name: benchmarks_windows
vmImage: 'windows-2019'

- template: jobs/benchmarks.yml
parameters:
name: benchmarks_linux
vmImage: 'ubuntu-18.04'

- template: jobs/benchmarks.yml
parameters:
name: benchmarks_mac
vmImage: 'macOS-10.15'

- template: jobs/benchmarks_net_full.yml
parameters:
name: benchmarks_net_full
vmImage: 'windows-2019'

- stage: Demo
dependsOn:
- Build_Test_Windows
- Build_Test_Linux
- Build_Test_MacOS
jobs:
- template: jobs/demo.yml
parameters:
name: demo_windows
vmImage: 'windows-2019'

- template: jobs/demo.yml
parameters:
name: demo_linux
vmImage: 'ubuntu-18.04'

- template: jobs/demo.yml
parameters:
name: demo_mac
vmImage: 'macOS-10.15'
8 changes: 2 additions & 6 deletions .azure/pipelines/jobs/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ jobs:
vmImage: ${{ parameters.vmImage }}
timeoutInMinutes: 0 # 360 minutes
steps:
# .NET Core 3 SDK is pre-installed
#- task: UseDotNet@2
# displayName: 'Use dotnet sdk 3.x'
# inputs:
# version: $(SDK_VERSION)
# includePreviewVersions: true
# ~SDKs already installed~
#- template: steps/dotnet-install.yml

- bash: |
chmod u+x *.sh
Expand Down
22 changes: 12 additions & 10 deletions .azure/pipelines/jobs/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,23 @@ jobs:
release-build:
BUILD_CONFIG: Release
steps:
# .NET 5.0 SDK is pre-installed
#- task: UseDotNet@2
# displayName: 'Use dotnet sdk 5.x'
# inputs:
# version: $(SDK_VERSION)
# includePreviewVersions: true
# ~SDKs already installed~
#- template: steps/dotnet-install.yml

- bash: |
echo 'installed sdks:'
dotnet --list-sdks
echo "-------------------------------------------------"
echo 'environment variables:'
env | sort
chmod u+x ./build.sh
displayName: init
- bash: ./build.sh build
displayName: build

# coverlet.msbuild must be added as package to the tests
- bash: ./build.sh test-coverage
displayName: test

Expand All @@ -42,20 +39,21 @@ jobs:
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
testRunTitle: 'test-$(Agent.JobName)'

- bash: |
cd tests/Coverage
workDir="$(System.DefaultWorkingDirectory)"
if [[ "$AGENT_OS" == "Windows_NT" ]]; then
# Windows needs special treetment for the substitution due the \
# Windows needs special treatment for the substitution due the \
workDir="${workDir//\\/\\\\}\\\\"
else
workDir+="/"
fi
# Mac has a different sed, so special case it (hooray for standars ;-))
# Mac has a different sed, so special case it (hooray for standards ;-))
if [[ "$AGENT_OS" != "Darwin" ]]; then
sed -i 's|<source>[^<]*</source>|<source>/</source>|g' "Cobertura.xml"
sed -i "s|${workDir}||g" "Cobertura.xml"
Expand All @@ -68,7 +66,10 @@ jobs:
# shortcut for PublishPipelineArtifact
# Coverage report will be created later in a different stage
- publish: tests/Coverage/Cobertura.xml
artifact: 'Coverage-${{ parameters.name }}-$(BUILD_CONFIG)'
# Using the JobName is a better choice than concatenating the paramaters
#artifact: 'Coverage-${{ parameters.vmImage }}-$(BUILD_CONFIG)'
artifact: 'Coverage-$(Agent.JobName)'
displayName: publish artifact code coverage

- bash: ./build.sh pack
displayName: pack
Expand All @@ -77,3 +78,4 @@ jobs:
- publish: 'NuGet-Packed'
artifact: 'NuGet-Packed'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['BUILD_CONFIG'], 'Release'), ne(variables['Build.Reason'], 'PullRequest'))
displayName: publish artifact NuGet package
26 changes: 12 additions & 14 deletions .azure/pipelines/jobs/build_and_test_intrinsics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,33 @@ jobs:
strategy:
matrix:
AVX_disabled:
COMPlus_EnableAVX: 0
DOTNET_EnableAVX: 0
SSE_disabled:
COMPlus_EnableSSE: 0
DOTNET_EnableSSE: 0
steps:
# .NET 5.0 SDK is pre-installed
#- task: UseDotNet@2
# displayName: 'Use dotnet sdk 5.x'
# inputs:
# version: $(SDK_VERSION)
# includePreviewVersions: true
# ~SDKs already installed~
#- template: steps/dotnet-install.yml

- bash: |
export PATH="$(pwd)/dotnet:$PATH"
echo 'installed sdks:'
dotnet --list-sdks
echo "-------------------------------------------------"
echo 'environment variables:'
env | sort
chmod u+x ./build.sh
displayName: init
- bash: ./build.sh build
displayName: build

- bash: |
if [[ "$COMPLUS_ENABLEAVX" == "0" ]]; then
if [[ "$DOTNET_ENABLEAVX" == "0" ]]; then
# TODO: update once .NET 6.0 target is used to DOTNET_ prefix.
export COMPlus_EnableAVX=0
fi
if [[ "$COMPLUS_ENABLESSE" == "0" ]]; then
if [[ "$DOTNET_ENABLESSE" == "0" ]]; then
export COMPlus_EnableSSE=0
fi
Expand Down Expand Up @@ -76,4 +71,7 @@ jobs:
# shortcut for PublishPipelineArtifact
# Coverage report will be created later in a different stage
- publish: tests/Coverage/Cobertura.xml
artifact: 'Coverage-${{ parameters.name }}-AVX_$(COMPLUS_ENABLEAVX)'
# Using the JobName is a better choice than concatenating the paramaters
#artifact: 'Coverage-${{ parameters.vmImage }}-$(BUILD_CONFIG)'
artifact: 'Coverage-$(Agent.JobName)'
displayName: publish artifact code coverage
Loading

0 comments on commit b2e332b

Please sign in to comment.