From c1098b6ae72e3397f45389c302f655356e37a046 Mon Sep 17 00:00:00 2001 From: Spiros Tsalikis Date: Wed, 8 Nov 2023 11:46:24 -0500 Subject: [PATCH] CI Contract: Build examples with external ADIOS --- .github/workflows/everything.yml | 5 +++-- testing/contract/examples/build.sh | 12 ++++++++++++ testing/contract/examples/config.sh | 17 +++++++++++++++++ testing/contract/examples/depends.sh | 3 +++ testing/contract/examples/install.sh | 12 ++++++++++++ testing/contract/examples/setup.sh | 13 +++++++++++++ testing/contract/examples/test.sh | 12 ++++++++++++ 7 files changed, 72 insertions(+), 2 deletions(-) create mode 100755 testing/contract/examples/build.sh create mode 100755 testing/contract/examples/config.sh create mode 100755 testing/contract/examples/depends.sh create mode 100755 testing/contract/examples/install.sh create mode 100755 testing/contract/examples/setup.sh create mode 100755 testing/contract/examples/test.sh diff --git a/.github/workflows/everything.yml b/.github/workflows/everything.yml index 706b3a4645..ae00aaddbf 100644 --- a/.github/workflows/everything.yml +++ b/.github/workflows/everything.yml @@ -7,7 +7,7 @@ # Note the use of multiple checkout actions in most jobs. This has been # implemented to allow the use of CI scripts at a different ref or sha than # the source code they're evaluating. For push events (when a pull_request is -# merged) ther is no difference. However, for pull_request events this allows +# merged) there is no difference. However, for pull_request events this allows # us test code at the head of a pull_request using the CI scripts from the # prospectively merged pull_request, which will include any CI updates that # may have made it to the target branch after the pull_request was started. @@ -451,8 +451,9 @@ jobs: strategy: fail-fast: false matrix: - code: [lammps, tau] + code: [examples, lammps, tau] include: + - code: examples - code: lammps repo: pnorbert/lammps ref: fix-deprecated-adios-init diff --git a/testing/contract/examples/build.sh b/testing/contract/examples/build.sh new file mode 100755 index 0000000000..0d2a15a363 --- /dev/null +++ b/testing/contract/examples/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x +set -e + +# shellcheck disable=SC1091 +source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/setup.sh + +# Fail if is not set +build_dir="${build_dir:?}" + +cmake --build "${build_dir}" -j8 \ No newline at end of file diff --git a/testing/contract/examples/config.sh b/testing/contract/examples/config.sh new file mode 100755 index 0000000000..79d1ea5964 --- /dev/null +++ b/testing/contract/examples/config.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -x +set -e + +# shellcheck disable=SC1091 +source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/setup.sh + +# Fail if is not set +source_dir="${source_dir:?}" +build_dir="${build_dir:?}" +install_dir="${install_dir:?}" + +mkdir -p "${build_dir}" +cd "${build_dir}" + +cmake -DCMAKE_INSTALL_PREFIX="${install_dir}" "${source_dir}" \ No newline at end of file diff --git a/testing/contract/examples/depends.sh b/testing/contract/examples/depends.sh new file mode 100755 index 0000000000..8c3cbfc39d --- /dev/null +++ b/testing/contract/examples/depends.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exit 0 diff --git a/testing/contract/examples/install.sh b/testing/contract/examples/install.sh new file mode 100755 index 0000000000..3581430e48 --- /dev/null +++ b/testing/contract/examples/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x +set -e + +# shellcheck disable=SC1091 +source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/setup.sh + +# Fail if is not set +build_dir="${build_dir:?}" + +cmake --install "${build_dir}" diff --git a/testing/contract/examples/setup.sh b/testing/contract/examples/setup.sh new file mode 100755 index 0000000000..ee88b0a2cc --- /dev/null +++ b/testing/contract/examples/setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +source_dir="/opt/adios2/source/examples" +build_dir=$(readlink -f "${PWD}")/build +install_dir=$(readlink -f "${PWD}")/install + +export source_dir +export build_dir +export install_dir + +echo "source_dir = \"${source_dir}\"" +echo "build_dir = \"${build_dir}\"" +echo "install_dir = \"${install_dir}\"" diff --git a/testing/contract/examples/test.sh b/testing/contract/examples/test.sh new file mode 100755 index 0000000000..1eae099c25 --- /dev/null +++ b/testing/contract/examples/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x +set -e + +# shellcheck disable=SC1091 +source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/setup.sh + +# Fail if is not set +install_dir="${install_dir:?}" + +"${install_dir}"/bin/adios2_hello_helloWorld