test-suite #1095
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2022 Dennis Gläser <dennis.glaeser@iws.uni-stuttgart.de> | |
# SPDX-License-Identifier: MIT | |
name: test-suite | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: | |
- main | |
- 'releases/**' | |
paths-ignore: | |
- 'docker/**' | |
schedule: | |
- cron: '30 22 * * 0,3' | |
workflow_dispatch: | |
workflow_call: | |
env: | |
DEFAULT_COMPILER_PKG: g++-12 | |
DEFAULT_C_COMPILER: gcc-12 | |
DEFAULT_CXX_COMPILER: g++-12 | |
OMPI_ALLOW_RUN_AS_ROOT: 1 | |
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | |
jobs: | |
test-compilers: | |
runs-on: ubuntu-22.04 | |
container: dglaeser/gridformat-action-images:full | |
strategy: | |
matrix: | |
compiler_pkg: [g++-12, clang-16] | |
include: | |
- c_compiler: gcc-12 | |
compiler_pkg: g++-12 | |
- cxx_compiler: g++-12 | |
compiler_pkg: g++-12 | |
- c_compiler: clang-16 | |
compiler_pkg: clang-16 | |
- cxx_compiler: clang++-16 | |
compiler_pkg: clang-16 | |
steps: | |
- name: checkout-repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: check-reuse-compliance | |
uses: fsfe/reuse-action@v2 | |
- name: Check CITATION.cff validity | |
uses: citation-file-format/cffconvert-github-action@2.0.0 | |
with: | |
args: "--validate" | |
- name: configure | |
run: | | |
rm -rf build | |
cmake -DCMAKE_C_COMPILER=${{matrix.c_compiler}} \ | |
-DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_PREFIX_PATH=/gfmt-dependencies \ | |
-DGRIDFORMAT_BUILD_BINARIES=ON \ | |
-DGRIDFORMAT_BUILD_TESTS=ON \ | |
-B build | tee gfmt_cmake_log.txt | |
- name: set-git-variables | |
uses: ./.github/actions/set-git-variables | |
- name: set-test-commands | |
uses: ./.github/actions/set-test-commands | |
with: | |
build_directory: build | |
source_tree: ${{ env.GFMT_SOURCE_TREE }} | |
target_tree: main | |
- name: check-documentation-code | |
run: | | |
python3 test/test_readme_quick_start.py \ | |
-r $GFMT_TREE \ | |
-e "-DCMAKE_C_COMPILER=/usr/bin/gcc-12 -DCMAKE_CXX_COMPILER=/usr/bin/g++-12" \ | |
-o "${GFMT_ORIGIN}" | |
python3 test/test_readme_tested_versions.py --cmake-log-file gfmt_cmake_log.txt | |
shell: bash | |
- name: build-binaries | |
run: cmake --build build | |
- name: build-tests | |
run: pushd build && $(echo "$GFMT_BUILD_CMD") && popd | |
shell: bash | |
- name: test | |
run: | | |
if [[ ${{ github.ref_name }} != "main" ]]; then | |
echo "Regression-testing sample files only for branch ${{ github.ref_name }}" | |
export GRIDFORMAT_REGRESSION_SAMPLES_ONLY=true | |
fi | |
pushd build && $(echo "$GFMT_TEST_CMD") && popd | |
shell: bash | |
- name: verify-no-skipped-tests | |
run: | | |
if [[ -e build/Testing/Temporary/LastTestsDisabled.log ]]; then | |
echo "The full test suite should not skip any tests. Making the job fail..." | |
exit 1 | |
else | |
echo "No skipped tests detected" | |
fi | |
shell: bash | |
mem-check: | |
runs-on: ubuntu-22.04 | |
container: dglaeser/gridformat-action-images:full | |
steps: | |
- name: checkout-repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: configure | |
run: | | |
rm -rf build | |
cmake -DCMAKE_C_COMPILER=/usr/bin/$DEFAULT_C_COMPILER \ | |
-DCMAKE_CXX_COMPILER=/usr/bin/$DEFAULT_CXX_COMPILER \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_PREFIX_PATH=/gfmt-dependencies \ | |
-DGRIDFORMAT_BUILD_TESTS=ON \ | |
-B build | |
- name: set-git-variables | |
uses: ./.github/actions/set-git-variables | |
- name: set-test-commands | |
uses: ./.github/actions/set-test-commands | |
with: | |
build_directory: build | |
source_tree: ${{ env.GFMT_SOURCE_TREE }} | |
target_tree: main | |
- name: run-memcheck | |
run: cd build && $(echo "$GFMT_MEMCHECK_CMD") | |
test-full-installation: | |
runs-on: ubuntu-22.04 | |
container: dglaeser/gridformat-action-images:full | |
steps: | |
- name: checkout-repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: test-installed-package | |
uses: ./.github/actions/test-installed-pkg | |
with: | |
c_compiler: /usr/bin/$DEFAULT_C_COMPILER | |
cxx_compiler: /usr/bin/$DEFAULT_CXX_COMPILER | |
test-minimal-installation: | |
runs-on: ubuntu-22.04 | |
container: dglaeser/gridformat-action-images:minimal | |
steps: | |
- name: checkout-repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: false | |
- name: test-installed-package | |
uses: ./.github/actions/test-installed-pkg | |
with: | |
c_compiler: /usr/bin/$DEFAULT_C_COMPILER | |
cxx_compiler: /usr/bin/$DEFAULT_CXX_COMPILER |