Skip to content

Commit

Permalink
Merge upstream @ 84891c9 to master
Browse files Browse the repository at this point in the history
  • Loading branch information
okellogg committed May 26, 2021
2 parents 3ea785c + 84891c9 commit 1f2eff4
Show file tree
Hide file tree
Showing 520 changed files with 53,953 additions and 23,928 deletions.
78 changes: 78 additions & 0 deletions .azure/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#
# Copyright(c) 2021 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

#
# Azure Pipeline specifically for building and submitting to Codecov
#

trigger: none
pr: none

schedules:
- cron: "0 12 * * 0"
branches:
include: [ master ]
always: false

strategy:
matrix:
'Ubuntu 20.04 LTS with GCC 10 (Debug, x86_64)':
image: ubuntu-20.04
cc: gcc-10
coverage: on

pool:
vmImage: $(image)

steps:
- template: /.azure/templates/build-test.yml
- bash: |
set -e -x
cd build
slug=$(echo "${BUILD_REPOSITORY_URI}" | sed -nE 's#.*/([^/]+/[^\]+)#\1#p')
commit="${BUILD_SOURCEVERSION}"
if [ -n "$pr" ] && [ "$pr" != false ]; then
mc=$(git show --no-patch --format="%P" 2>/dev/null || echo "")
if [[ "$mc" =~ ^[a-z0-9]{40}[[:space:]][a-z0-9]{40}$ ]]; then
mc=$(echo "$mc" | cut -d ' ' -f2)
commit=$mc
fi
fi
query=$(curl -Gso /dev/null -w "%{url_effective}" "" \
--data-urlencode "package=cmake-codecov.io" \
--data-urlencode "token=${token}" \
--data-urlencode "branch=${BUILD_SOURCEBRANCH#/refs/heads/}" \
--data-urlencode "commit=${commit}" \
--data-urlencode "build=${BUILD_BUILDNUMBER}" \
--data-urlencode "build_url=${SYSTEM_TEAMFOUNDATIONSERVERURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}" \
--data-urlencode "tag=" \
--data-urlencode "slug=${slug}" \
--data-urlencode "service=azure_pipelines" \
--data-urlencode "flags=" \
--data-urlencode "pr=${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-$SYSTEM_PULLREQUEST_PULLREQUESTID}" \
--data-urlencode "job=${BUILD_BUILDID}" \
--data-urlencode "project=${SYSTEM_TEAMPROJECT}" \
--data-urlencode "server_uri=${SYSTEM_TEAMFOUNDATIONSERVERURI}" \
2>/dev/null | cut -c 3- | sed -e 's/%0A//')
cmake --build . --target codecov
code=$(curl -X POST -w "%{http_code}" \
--data-binary @"codecov.tar.gz" \
--retry 5 --retry-delay 2 --connect-timeout 2 \
-H 'Content-Type: text/plain' \
-H 'Content-Encoding: gzip' \
-H 'X-Content-Encoding: gzip' \
-H 'Accept: text/plain' \
"https://codecov.io/upload/v2?$query")
[[ "${code}" =~ "success" ]] || (echo "cURL exited with ${code}" 1>&2 && exit 1)
name: submit_to_codecov
env:
token: $(CODECOV_TOKEN)
102 changes: 102 additions & 0 deletions .azure/coverity-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#
# Copyright(c) 2021 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

#
# Azure Pipeline specifically for building and submitting to Coverity Scan
#

trigger: none
pr: none

schedules:
- cron: "0 12 * * 0"
branches:
include: [ master ]
always: false

strategy:
matrix:
'Ubuntu 20.04 LTS with GCC 10 (Debug, x86_64)':
image: ubuntu-20.04
cc: gcc-10

pool:
vmImage: $(image)

steps:
## Fetch version number to ensure up-to-date cache
- bash: |
set -e
slug=$(echo "${BUILD_REPOSITORY_URI}" | sed -nE 's#.*/([^/]+/[^\]+)#\1#p')
headers=$(basename $(mktemp "$(pwd)/curl.XXXXXXXX"))
code=$(curl -X HEAD -s -S -F project="${slug}" \
-F token="${token}" \
-o /dev/null -D ${headers} -w '%{http_code}' \
"https://scan.coverity.com/download/cxx/linux64")
[ "${code}" != "200" ] && echo "cURL exited with ${code}" 1>&2 && exit 1
file=$(sed -n -E 's/.*filename="([^"]+)".*/\1/p' ${headers})
echo "###vso[task.setvariable variable=cov_archive;]${file}"
echo "###vso[task.setvariable variable=cov_analysis;]$(pwd)/cov-analysis"
echo "###vso[task.setvariable variable=PATH;]$(pwd)/cov-analysis/bin:${PATH}"
rm -f ${headers}
name: setup_coverity
env:
token: $(COVERITY_SCAN_TOKEN)
- task: Cache@2
inputs:
key: coverity | 1 | "$(cov_archive)"
path: $(cov_analysis)
cacheHitVar: coverity_cached
name: cache_coverity
## Download Coverity on cache miss
- bash: |
set -e
slug=$(echo "${BUILD_REPOSITORY_URI}" | sed -nE 's#.*/([^/]+/[^\]+)#\1#p')
headers=$(basename $(mktemp "$(pwd)/tmp.XXXXXXXX"))
code=$(curl -s -S -F project="${slug}" \
-F token="${token}" \
-O -J -D ${headers} -w '%{http_code}' \
"https://scan.coverity.com/download/cxx/linux64")
[ "${code}" != "200" ] && echo "cURL exited with ${code}" 1>&2 && exit 1
file=$(sed -n -E 's/^.*filename="([^"]+)".*$/\1/p' ${headers})
tar -xzf ${file} -C .
dir=$(find . -type d -name "cov-analysis*" | head -1)
mv "${dir}" "${COV_ANALYSIS}"
rm -f ${headers} "${file}"
name: install_coverity
condition: ne(variables['coverity_cached'], 'true')
env:
token: $(COVERITY_SCAN_TOKEN)
- bash: |
set -e -x
echo "###vso[task.setvariable variable=scan_build;]cov-build --dir $(pwd)/cov-int"
cov-configure --template --compiler ${CC} --comptype gcc
name: configure_coverity
- template: /.azure/templates/build-test.yml
## Submit to Coverity Scan
- bash: |
set -e -x
slug=$(echo "${BUILD_REPOSITORY_URI}" | sed -nE 's#.*/([^/]+/[^\]+)#\1#p')
tar -czf analysis-results.tgz cov-int
code=$(curl -s -S -F project="${slug}" \
-F token="${token}" \
-F [email protected] \
-F version=$(git rev-parse --short HEAD) \
-F description="Azure Pipelines build" \
-F email="${COVERITY_SCAN_EMAIL:[email protected]}" \
-w '%{http_code}' \
"https://scan.coverity.com/builds")
[[ "${code}" =~ "success" ]] || (echo "cURL exited with ${code}" 1>&2 && exit 1)
rm -f analysis-results.tgz
name: submit_to_coverity_scan
env:
token: $(COVERITY_SCAN_TOKEN)
123 changes: 123 additions & 0 deletions .azure/templates/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#
# Copyright(c) 2021 ADLINK Technology Limited and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#

#
# Template with basic build and test instructions to be included by pipelines.
#

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
name: install_python
# Set defaults from steps to share them among pipelines
- bash: |
[[ -n "${ARCH}" ]] || \
echo "###vso[task.setvariable variable=arch;]x86_64"
[[ -n "${BUILD_TYPE}" ]] || \
echo "###vso[task.setvariable variable=build_type;]Debug"
name: setup
- bash: |
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/.cache/pip"
echo "###vso[task.setvariable variable=conan_cache;]${HOME}/.conan/data"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
sudo apt-get install -y clang-tools clang-tidy
condition: eq(variables['Agent.OS'], 'Linux')
name: setup_linux
- bash: |
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/Library/Caches/pip"
echo "###vso[task.setvariable variable=conan_cache;]${HOME}/.conan/data"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
brew install bison
condition: eq(variables['Agent.OS'], 'Darwin')
name: setup_macos
# Use PowerShell rather than Bash to ensure Windows-style paths
- pwsh: |
$python_bin = python -m site --user-base
Write-Host "###vso[task.setvariable variable=pip_cache;]${env:LOCALAPPDATA}\\pip\\Cache"
Write-Host "###vso[task.setvariable variable=conan_cache;]${env:USERPROFILE}\\.conan\\data"
Write-Host "###vso[task.setvariable variable=PATH;]$python_bin\\bin;${env:PATH}"
# Visual Studio is most likely used on Windows agents
if (${env:GENERATOR} -match "2019" -and -not ${env:PLATFORM}) {
# Make sure platform matches arch if not specified
if (${env:ARCH} -match "arm*") {
Write-Host "###vso[task.setvariable variable=platform;]ARM"
} elseif (${env:ARCH} -eq "x86") {
Write-Host "###vso[task.setvariable variable=platform;]x86"
} else {
Write-Host "###vso[task.setvariable variable=platform;]x64"
}
}
Write-Host "###vso[task.setvariable variable=build_tool_options;]-nologo -verbosity:minimal -maxcpucount:4 -p:CL_MPCount=4"
choco install winflexbison3
condition: eq(variables['Agent.OS'], 'Windows_NT')
name: setup_windows
- task: Cache@2
inputs:
key: pip | 2 | $(Agent.OS)
path: $(pip_cache)
name: cache_pip
- task: Cache@2
inputs:
key: conan | 3 | $(Agent.OS) | $(arch) | $(build_type)
path: $(conan_cache)
name: cache_conan
- bash: |
set -e -x
pip install conan --user
conan profile new default --detect
name: install_conan
- bash: |
set -e -x
mkdir build
cd build
conan install -b missing -s arch=${ARCH} -s build_type=${BUILD_TYPE} ../${CONANFILE:-conanfile.txt}
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=install \
-DANALYZER=${ANALYZER:-off} \
-DSANITIZER=${SANITIZER:-none} \
-DENABLE_SSL=${SSL:-on} \
-DENABLE_SECURITY=${SECURITY:-on} \
-DENABLE_LIFESPAN=${LIFESPAN:-on} \
-DENABLE_DEADLINE_MISSED=${DEADLINE_MISSED:-on} \
-DENABLE_TYPE_DISCOVERY=${TYPE_DISCOVERY:-on} \
-DENABLE_TOPIC_DISCOVERY=${TOPIC_DISCOVERY:-on} \
-DENABLE_COVERAGE=${COVERAGE:-off} \
-DBUILD_TESTING=on \
-DBUILD_EXAMPLES=on \
-DWERROR=on \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" ..
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install -- ${BUILD_TOOL_OPTIONS}
${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target package -- ${BUILD_TOOL_OPTIONS}
name: script
- bash: |
set -e -x
cd build
ctest -j 4 --output-on-failure -T test -E '^CUnit_ddsrt_random_default_random$' -C ${BUILD_TYPE}
[[ "${BUILD_TYPE}" != 'Release' ]] || \
${SHELL} ../src/tools/ddsperf/sanity.bash
[[ "${SSL:-on}" != 'on' || "${SECURITY:-on}" != 'on' ]] || \
diff --strip-trailing-cr ../etc/cyclonedds.rnc docs/cyclonedds.rnc && \
diff --strip-trailing-cr ../etc/cyclonedds.xsd docs/cyclonedds.xsd && \
diff --strip-trailing-cr ../docs/manual/options.md docs/manual/options.md
[[ "${SANTIZIER:-none}" == 'none' ]] || \
export CFLAGS="-fsanitize=${SANITIZER}" LDFLAGS="-fsanitize=${SANITIZER}"
INSTALLPREFIX="$(pwd)/install"
mkdir helloworld
cd helloworld
cmake -DCMAKE_PREFIX_PATH="${INSTALLPREFIX}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
${GENERATOR:+-G} "${GENERATOR}" "${INSTALLPREFIX}/share/CycloneDDS/examples/helloworld"
name: test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ gen.*
.project
.settings/
.vs/
.vscode/
build/
docs/manual/ddsc_api_docs/
Loading

0 comments on commit 1f2eff4

Please sign in to comment.