|
| 1 | +--- |
| 2 | +# Copyright 2015-2019 Rene Rivera. |
| 3 | +# Copyright 2019 Mateusz Loskot <mateusz at loskot dot net> |
| 4 | +# Copyright 2020-2021 Alexander Grund |
| 5 | +# Distributed under the Boost Software License, Version 1.0. |
| 6 | +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) |
| 7 | + |
| 8 | +# |
| 9 | +# Generic Azure Pipelines build script for boostorg repositories |
| 10 | +# See: https://github.com/boostorg/boost-ci/ |
| 11 | +# |
| 12 | +# Instructions for customizing this script for your library: |
| 13 | +# |
| 14 | +# 1. Customize the compilers and language levels you want. |
| 15 | +# 2. If you have more than include/, src/, test/, example/, examples/, |
| 16 | +# benchmark/ or tools/ directories, set the environment variable DEPINST. |
| 17 | +# For example if your build uses code in "bench/" and "fog/" directories: |
| 18 | +# - DEPINST: --include bench --include fog |
| 19 | +# 3. Enable pull request builds in your boostorg/<library> account. |
| 20 | +# |
| 21 | +# That's it - the script will do everything else for you. |
| 22 | + |
| 23 | +trigger: |
| 24 | + branches: |
| 25 | + include: |
| 26 | + - develop |
| 27 | + - master |
| 28 | + - bugfix/* |
| 29 | + - feature/* |
| 30 | + - fix/* |
| 31 | + - pr/* |
| 32 | + |
| 33 | +pr: [develop, master, main] |
| 34 | + |
| 35 | +variables: |
| 36 | + GIT_FETCH_JOBS: 4 |
| 37 | + NET_RETRY_COUNT: 5 |
| 38 | + B2_CI_VERSION: 1 |
| 39 | + B2_VARIANT: release,debug |
| 40 | + B2_LINK: shared,static |
| 41 | + |
| 42 | +# Dummy runtime parameter to allow creating conditional jobs |
| 43 | +parameters: |
| 44 | + - name: jobs |
| 45 | + type: object |
| 46 | + default: |
| 47 | + - { compiler: gcc-11, cxxstd: '14,17,20', os: ubuntu-20.04 } |
| 48 | + - { compiler: gcc-10, cxxstd: '14,17,20', os: ubuntu-20.04 } |
| 49 | + - { compiler: gcc-9, cxxstd: '14,17,2a', os: ubuntu-20.04 } |
| 50 | + - { compiler: gcc-8, cxxstd: '14,17,2a', os: ubuntu-20.04 } |
| 51 | + - { compiler: gcc-7, cxxstd: '11,14,17', os: ubuntu-18.04 } |
| 52 | + - { compiler: gcc-6, cxxstd: '11,14', os: ubuntu-18.04 } |
| 53 | + - { compiler: gcc-5, cxxstd: '11', os: ubuntu-18.04 } |
| 54 | + - { compiler: gcc-4.9, cxxstd: '11', os: ubuntu-18.04, container: 'ubuntu:16.04' } |
| 55 | + - { compiler: gcc-4.8, cxxstd: '11', os: ubuntu-18.04 } |
| 56 | + - { compiler: clang-12, cxxstd: '14,17,20', os: ubuntu-20.04 } |
| 57 | + - { compiler: clang-11, cxxstd: '14,17,20', os: ubuntu-20.04 } |
| 58 | + - { compiler: clang-10, cxxstd: '14,17,20', os: ubuntu-20.04 } |
| 59 | + - { compiler: clang-9, cxxstd: '14,17,2a', os: ubuntu-20.04 } |
| 60 | + - { compiler: clang-8, cxxstd: '14,17', os: ubuntu-18.04, install: 'clang-8 libc6-dbg libc++-dev libstdc++-8-dev' } |
| 61 | + - { compiler: clang-7, cxxstd: '14,17', os: ubuntu-18.04, install: 'clang-7 libc6-dbg libc++-dev libstdc++-8-dev' } |
| 62 | + - { compiler: clang-6.0, cxxstd: '11,14,17', os: ubuntu-18.04, install: 'clang-6.0 libc6-dbg libc++-dev libc++abi-dev libstdc++-8-dev' } |
| 63 | + - { name: Linux_clang_6_libcxx, |
| 64 | + compiler: clang-6.0, cxxstd: '11,14,17', os: ubuntu-18.04, install: 'clang-6.0 libc6-dbg libc++-dev libc++abi-dev libstdc++-8-dev', env: {B2_STDLIB: libc++ } } |
| 65 | + - { compiler: clang-5.0, cxxstd: '11,14,17', os: ubuntu-18.04 } |
| 66 | + - { compiler: clang-4.0, cxxstd: '11,14', os: ubuntu-18.04 } |
| 67 | + - { compiler: clang-3.9, cxxstd: '11,14', os: ubuntu-18.04 } |
| 68 | + - { compiler: clang-3.8, cxxstd: '11,14', os: ubuntu-18.04, container: 'ubuntu:16.04' } |
| 69 | + - { compiler: clang-3.7, cxxstd: '11', os: ubuntu-18.04, container: 'ubuntu:16.04' } |
| 70 | + - { compiler: clang-3.6, cxxstd: '11', os: ubuntu-18.04, container: 'ubuntu:16.04' } |
| 71 | + - { compiler: clang-3.5, cxxstd: '11', os: ubuntu-18.04, container: 'ubuntu:16.04' } |
| 72 | + # OSX |
| 73 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 12.4 } |
| 74 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 12.3 } |
| 75 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 12.2 } |
| 76 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 12.1.1 } |
| 77 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 12.0.1 } |
| 78 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.7 } |
| 79 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.6 } |
| 80 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.5 } |
| 81 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.4.1 } |
| 82 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.3.1 } |
| 83 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.2.1 } |
| 84 | + - { compiler: clang, cxxstd: '14,17,2a', os: macOS-10.15, xcode: 11.3 } |
| 85 | + |
| 86 | +stages: |
| 87 | + - stage: Test |
| 88 | + jobs: |
| 89 | + # Dynamically generate jobs to be able to insert containers, see https://stackoverflow.com/questions/70046143 |
| 90 | + - ${{ each item in parameters.jobs }}: |
| 91 | + - ${{ if item.name }}: |
| 92 | + job: ${{ item.name }} |
| 93 | + ${{ elseif contains(item.os, 'macOS') }}: |
| 94 | + job: macOS_${{ replace(item.xcode, '.', '_') }} |
| 95 | + ${{ else }}: |
| 96 | + job: Linux_${{ replace(replace(item.compiler, '-', '_'), '.', '_') }} |
| 97 | + pool: |
| 98 | + vmImage: ${{ item.os }} |
| 99 | + ${{ if item.container }}: |
| 100 | + container: |
| 101 | + image: ${{ item.container }} |
| 102 | + # Workaround for missing sudo: https://github.com/microsoft/azure-pipelines-agent/issues/2043 |
| 103 | + options: --name ci-container -v /usr/bin/docker:/tmp/docker:ro |
| 104 | + variables: |
| 105 | + B2_COMPILER: ${{ item.compiler }} |
| 106 | + B2_CXXSTD: ${{ item.cxxstd }} |
| 107 | + ${{ if not(contains(item.os, 'macOS')) }}: |
| 108 | + B2_USE_CCACHE: 1 |
| 109 | + B2_CCACHE_DIR: $(Pipeline.Workspace)/.ccache |
| 110 | + ${{ if item.xcode }}: |
| 111 | + XCODE_APP: /Applications/Xcode_${{ item.xcode }}.app |
| 112 | + ${{ if item.install }}: |
| 113 | + PACKAGES: ${{ item.install }} |
| 114 | + ${{ each var in item.env }}: |
| 115 | + ${{var.Key}}: ${{var.Value}} |
| 116 | + steps: |
| 117 | + - ${{ if item.container }}: |
| 118 | + - bash: | |
| 119 | + set -ex |
| 120 | + /tmp/docker exec -t -u 0 ci-container \ |
| 121 | + sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::='--force-confold' -y install sudo software-properties-common" |
| 122 | + # Need (newer) git |
| 123 | + sudo add-apt-repository ppa:git-core/ppa |
| 124 | + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update |
| 125 | + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python libpython-dev git |
| 126 | + displayName: 'Install required sw for containers' |
| 127 | + - task: Cache@2 |
| 128 | + condition: eq(variables.B2_USE_CCACHE, '1') |
| 129 | + inputs: |
| 130 | + key: 'ccache|"${{ item.os }}-${{ item.container }}"|"${{ item.compiler }}"' |
| 131 | + path: $(B2_CCACHE_DIR) |
| 132 | + displayName: Get CCache |
| 133 | + - bash: | |
| 134 | + set -ex |
| 135 | +
|
| 136 | + for i in {1..$NET_RETRY_COUNT}; do |
| 137 | + git clone --depth 1 --branch master https://github.com/boostorg/boost-ci.git boost-ci-cloned && break || sleep 10 |
| 138 | + done |
| 139 | + # Copy ci folder if not testing Boost.CI |
| 140 | + [[ $(basename "$BUILD_REPOSITORY_NAME") = "boost-ci" ]] || cp -prf boost-ci-cloned/ci . |
| 141 | + rm -rf boost-ci-cloned |
| 142 | + source ci/azure-pipelines/install.sh |
| 143 | + displayName: 'Install' |
| 144 | + - bash: | |
| 145 | + set -ex |
| 146 | +
|
| 147 | + echo "customization - url" |
| 148 | + cd $BOOST_ROOT/libs |
| 149 | + git clone https://github.com/CPPAlliance/url -b develop |
| 150 | + echo "end customization - url" |
| 151 | +
|
| 152 | + echo "SELF=$SELF" |
| 153 | + echo "BOOST_ROOT=$BOOST_ROOT" |
| 154 | + cd $BOOST_ROOT/libs/$SELF |
| 155 | + ci/azure-pipelines/build.sh |
| 156 | + displayName: 'Build' |
| 157 | +
|
| 158 | + - job: 'Windows' |
| 159 | + timeoutInMinutes: 120 |
| 160 | + strategy: |
| 161 | + matrix: |
| 162 | + VS_2022: |
| 163 | + B2_TOOLSET: msvc-14.3 |
| 164 | + B2_CXXSTD: 14,17,20 |
| 165 | + B2_ADDRESS_MODEL: 32,64 |
| 166 | + VM_IMAGE: 'windows-2022' |
| 167 | + VS_2022_strict: |
| 168 | + B2_TOOLSET: msvc-14.3 |
| 169 | + B2_CXXSTD: 14,17,20 |
| 170 | + B2_CXXFLAGS: -permissive- |
| 171 | + B2_ADDRESS_MODEL: 32,64 |
| 172 | + VM_IMAGE: 'windows-2022' |
| 173 | + VS_2019: |
| 174 | + B2_TOOLSET: msvc-14.2 |
| 175 | + B2_CXXSTD: 14,17,20 |
| 176 | + B2_ADDRESS_MODEL: 32,64 |
| 177 | + VM_IMAGE: 'windows-2019' |
| 178 | + VS_2019_strict: |
| 179 | + B2_TOOLSET: msvc-14.2 |
| 180 | + B2_CXXSTD: 14,17,20 |
| 181 | + B2_CXXFLAGS: -permissive- |
| 182 | + B2_ADDRESS_MODEL: 32,64 |
| 183 | + VM_IMAGE: 'windows-2019' |
| 184 | + |
| 185 | + pool: |
| 186 | + vmImage: $(VM_IMAGE) |
| 187 | + steps: |
| 188 | + - script: | |
| 189 | + git clone --depth 1 --branch master https://github.com/boostorg/boost-ci.git boost-ci-cloned |
| 190 | + REM Copy ci folder if not testing Boost.CI |
| 191 | + if "%BUILD_REPOSITORY_NAME%" == "%BUILD_REPOSITORY_NAME:boost-ci=%" xcopy /s /e /q /i /y boost-ci-cloned\ci .\ci |
| 192 | + rmdir /s /q boost-ci-cloned |
| 193 | + ci\azure-pipelines\install.bat |
| 194 | + displayName: 'Install' |
| 195 | + - script: ci\build.bat |
| 196 | + displayName: 'Build' |
0 commit comments