charls/azure-pipelines.yml
Victor Derks 66a3605fd9
Add REUSE compatibility (#338)
- Follow the best practices of https://reuse.software/ to ensure BSD-3 licence is correctly applied.
- Add a badge to README.md
- Note: remove arm build as the CI pipeline is broken for this architecture
2024-12-04 12:33:36 +01:00

307 lines
6.8 KiB
YAML

# Copyright (c) Team CharLS.
# SPDX-License-Identifier: BSD-3-Clause
# Branches that trigger a build on commit
trigger:
- main
- release/*
# Branches that trigger builds on PR
pr:
branches:
include:
- main
- release/*
variables:
solution: '*.sln'
jobs:
- job: 'cppWindows'
pool:
vmImage: windows-2022
displayName: 'Solution MSVC 2022'
strategy:
matrix:
x86 Debug:
buildPlatform: 'x86'
buildConfiguration: 'Debug'
x86 Release:
buildPlatform: 'x86'
buildConfiguration: 'Release'
x64 Debug:
buildPlatform: 'x64'
buildConfiguration: 'Debug'
x64 Release:
buildPlatform: 'x64'
buildConfiguration: 'Release'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
includeNuGetOrg: true
restoreSolution: '*.sln'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
maximumCpuCount: true
msbuildArgs: -p:CHARLS_PROFILE=true -p:CHARLS_ALL_WARNINGS=true
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
runInParallel: true
resultsFolder: '$(build.ArtifactStagingDirectory)/Test/Results'
codeCoverageEnabled: true
runSettingsFile: 'unittest\CodeCoverage.runsettings'
- job: 'cppVS2022'
pool:
vmImage: windows-2022
displayName: 'CMake - MSVC 2022'
strategy:
matrix:
x64 Debug:
BuildType: Debug
Architecture: x64
Shared: 'OFF'
x64 Release:
BuildType: Release
Architecture: x64
Shared: 'OFF'
x64 Release Shared:
BuildType: Release
Architecture: x64
Shared: 'ON'
x86 Debug:
BuildType: Debug
Architecture: x86
Shared: 'OFF'
x86 Release:
BuildType: Release
Architecture: x86
Shared: 'OFF'
ARM64 Release:
BuildType: Release
Architecture: x64_arm64
Shared: 'OFF'
steps:
- script: choco install ninja
displayName: Install Ninja
- task: BatchScript@1
inputs:
filename: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"
arguments: $(Architecture)
modifyEnvironment: true
displayName: Setup Environment Variables
- task: CMake@1
displayName: "Configure CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs:
-G Ninja
-DCMAKE_C_COMPILER="cl.exe"
-DCMAKE_CXX_COMPILER="cl.exe"
-DCMAKE_BUILD_TYPE=$(buildType)
-DBUILD_SHARED_LIBS=$(Shared)
-DCHARLS_PEDANTIC_WARNINGS=On
-DCHARLS_TREAT_WARNING_AS_ERROR=On
$(Build.SourcesDirectory)
- task: CMake@1
displayName: "Build CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs: --build $(Build.BinariesDirectory)/build
- job: 'cppVS2019'
pool:
vmImage: windows-2019
displayName: 'CMake - MSVC 2019'
strategy:
matrix:
x64 Debug:
BuildType: Debug
Architecture: x64
x64 Release:
BuildType: Release
Architecture: x64
x86 Debug:
BuildType: Debug
Architecture: x86
x86 Release:
BuildType: Release
Architecture: x86
steps:
- script: choco install ninja
displayName: Install Ninja
- task: BatchScript@1
inputs:
filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"
arguments: $(Architecture)
modifyEnvironment: true
displayName: Setup Environment Variables
- task: CMake@1
displayName: "Configure CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs:
-G Ninja
-DCMAKE_C_COMPILER="cl.exe"
-DCMAKE_CXX_COMPILER="cl.exe"
-DCMAKE_BUILD_TYPE=$(buildType)
-DCHARLS_PEDANTIC_WARNINGS=On
-DCHARLS_TREAT_WARNING_AS_ERROR=On
$(Build.SourcesDirectory)
- task: CMake@1
displayName: "Build CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs: --build $(Build.BinariesDirectory)/build
- script: ctest
displayName: "Testing CharLS"
workingDirectory: $(Build.BinariesDirectory)/build
- job: 'cppLinux'
pool:
vmImage: ubuntu-latest
displayName: 'CMake - '
strategy:
matrix:
GCC-9 Debug:
buildType: Debug
CC: gcc-9
CXX: g++-9
Shared: 'OFF'
GCC-10 Release:
buildType: Release
CC: gcc-10
CXX: g++-10
Shared: 'OFF'
GCC-11 Debug Shared:
buildType: Debug
CC: gcc-11
CXX: g++-11
Shared: 'ON'
GCC-12 Release Shared:
buildType: Release
CC: gcc-12
CXX: g++-12
Shared: 'ON'
Clang-13 Debug:
buildType: Debug
CC: clang-13
CXX: clang++-13
Shared: 'OFF'
Clang-13 Release:
buildType: Release
CC: clang-13
CXX: clang++-13
Shared: 'OFF'
Clang-14 Release Shared:
buildType: Release
CC: clang-14
CXX: clang++-14
Shared: 'ON'
steps:
- script: mkdir $(Build.BinariesDirectory)/build
displayName: "Create build folder"
- task: CMake@1
displayName: "Configure CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs:
-DCMAKE_BUILD_TYPE=$(buildType)
-DBUILD_SHARED_LIBS=$(Shared)
-DCHARLS_PEDANTIC_WARNINGS=On
-DCHARLS_TREAT_WARNING_AS_ERROR=On
$(Build.SourcesDirectory)
- task: CMake@1
displayName: "Build CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs: --build .
- script: ctest
displayName: "Testing CharLS"
workingDirectory: $(Build.BinariesDirectory)/build
- job: 'cppmacOS'
pool:
vmImage: macOS-latest
displayName: 'CMake - '
strategy:
matrix:
Xcode Debug:
buildType: Debug
Shared: 'OFF'
Xcode Release:
buildType: Release
Shared: 'ON'
steps:
- script: mkdir $(Build.BinariesDirectory)/build
displayName: "Create build folder"
- task: CMake@1
displayName: "Configure CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs:
-DCMAKE_BUILD_TYPE=$(buildType
-DBUILD_SHARED_LIBS=$(Shared)
-DCHARLS_PEDANTIC_WARNINGS=On
-DCHARLS_TREAT_WARNING_AS_ERROR=On
$(Build.SourcesDirectory)
- task: CMake@1
displayName: "Build CharLS"
inputs:
workingDirectory: $(Build.BinariesDirectory)/build
cmakeArgs: --build .
- script: ctest
displayName: "Testing CharLS"
workingDirectory: $(Build.BinariesDirectory)/build