Skip to content

Commit

Permalink
Merge pull request #11 from LLNL/task/linux_build-set
Browse files Browse the repository at this point in the history
Added azure builds and tests for basic linux configuration.
  • Loading branch information
rhornung67 committed May 1, 2019
2 parents 5808439 + e550f8f commit 794110f
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 14 deletions.
64 changes: 50 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,55 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
#
# Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and
# other Axom Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
#

trigger:
- master
variables:
DO_BUILD: 'yes'
DO_TEST: 'yes'

strategy:
matrix:
linux_gcc6:
VM_ImageName: 'ubuntu-16.04'
Compiler_ImageName: 'axom/compilers:gcc-6'
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE=Off'
COMPILER: 'g++'
TEST_TARGET: 'linux_gcc6'
linux_gcc7:
VM_ImageName: 'ubuntu-16.04'
Compiler_ImageName: 'axom/compilers:gcc-7'
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE=Off'
COMPILER: 'g++'
TEST_TARGET: 'linux_gcc7'
linux_clang4:
VM_ImageName: 'ubuntu-16.04'
Compiler_ImageName: 'axom/compilers:clang-4'
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE=Off'
COMPILER: 'clang++'
TEST_TARGET: 'linux_clang4'
linux_clang6:
VM_ImageName: 'ubuntu-16.04'
Compiler_ImageName: 'axom/compilers:clang-6'
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE=Off'
COMPILER: 'clang++'
TEST_TARGET: 'linux_clang6'

pool:
vmImage: 'Ubuntu-16.04'
vmImage: $(VM_ImageName)

steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'

- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
- checkout: self
clean: boolean
submodules: recursive
- script: |
docker run --rm --user='root' -v `pwd`:/home/axom $(Compiler_ImageName) chown -R axom /home/axom
docker run --rm -v `pwd`:/home/axom -e TEST_TARGET -e COMPILER -e DO_BUILD -e DO_TEST -e CMAKE_EXTRA_FLAGS $(Compiler_ImageName) ./scripts/azure-pipelines/linux-build_and_test.sh
condition: eq( variables['Agent.OS'], 'Linux')
displayName: '$(TEST_TARGET) Build & Test'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'cTest'
testResultsFiles: '**/Test.xml'
testRunTitle: '$(TEST_TARGET) Tests'
36 changes: 36 additions & 0 deletions scripts/azure-pipelines/linux-build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
##############################################################################
# Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and
# other Axom Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
##############################################################################

env
function or_die () {
"$@"
local status=$?
if [[ $status != 0 ]] ; then
echo ERROR $status command: $@
exit $status
fi
}

or_die mkdir azure-${Test_Target}-build
cd azure-${Test_Target}-build
if [[ "$DO_BUILD" == "yes" ]] ; then
or_die cmake -DCMAKE_CXX_COMPILER="${COMPILER}" ${CMAKE_EXTRA_FLAGS} ../src
if [[ ${CMAKE_EXTRA_FLAGS} == *COVERAGE* ]] ; then
or_die make -j 3
else
or_die make -j 3 VERBOSE=1
fi
if [[ "${DO_TEST}" == "yes" ]] ; then
or_die ctest -T test --output-on-failure -V
fi
if [[ "${DO_MEMCHECK}" == "yes" ]] ; then
or_die ctest -T memcheck
fi
fi

exit 0

0 comments on commit 794110f

Please sign in to comment.