Skip to content

test-suite

test-suite #1197

Workflow file for this run

# SPDX-FileCopyrightText: 2022 Dennis Gläser <[email protected]>
# SPDX-License-Identifier: MIT
name: test-suite
on:
push:
branches: [main]
pull_request:
branches:
- main
- 'releases/**'
paths:
- '**/CMakeLists.txt'
- '**/*.cmake'
- '**/*.hpp'
- '**/*.cpp'
- '.github/'
schedule:
- cron: '30 22 * * 0'
workflow_dispatch:
workflow_call:
env:
DEFAULT_C_COMPILER: gcc-14
DEFAULT_CXX_COMPILER: g++-14
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
jobs:
sanity-checks:
runs-on: ubuntu-24.04
container: dglaeser/gridformat-action-images:full
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/[email protected]
with:
args: "--validate"
- name: prepare-python-env
uses: ./.github/actions/prepare-python-env
- name: configure
run: |
rm -rf build
cmake -DCMAKE_C_COMPILER=$DEFAULT_C_COMPILER \
-DCMAKE_CXX_COMPILER=$DEFAULT_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: check-documentation-code
run: |
python3 test/test_readme_quick_start.py \
-r $GFMT_SOURCE_TREE \
-e "-DCMAKE_C_COMPILER=/usr/bin/gcc-12 -DCMAKE_CXX_COMPILER=/usr/bin/g++-12" \
-o "${GFMT_SOURCE_REMOTE}"
python3 test/test_readme_tested_versions.py --cmake-log-file gfmt_cmake_log.txt
shell: bash
mem-check:
needs: sanity-checks
runs-on: ubuntu-24.04
container: dglaeser/gridformat-action-images:full
steps:
- name: checkout-repository
uses: actions/checkout@v2
with:
submodules: true
- name: prepare-python-env
uses: ./.github/actions/prepare-python-env
- 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_remote: ${{ env.GFMT_SOURCE_REMOTE }}
source_tree: ${{ env.GFMT_SOURCE_TREE }}
target_remote: ${{ env.GFMT_TARGET_REMOTE }}
target_tree: ${{ env.GFMT_TARGET_TREE }}
- name: run-memcheck
run: cd build && $(echo "$GFMT_MEMCHECK_CMD")
test-full-installation:
needs: sanity-checks
runs-on: ubuntu-24.04
container: dglaeser/gridformat-action-images:full
strategy:
matrix:
compiler_pkg: [g++-14, clang-18]
include:
- c_compiler: gcc-14
compiler_pkg: g++-14
- cxx_compiler: g++-14
compiler_pkg: g++-14
- c_compiler: clang-18
compiler_pkg: clang-18
- cxx_compiler: clang++-18
compiler_pkg: clang-18
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/${{ matrix.c_compiler }}
cxx_compiler: /usr/bin/${{ matrix.cxx_compiler }}
allow_skipped_tests: false
test-minimal-installation:
needs: sanity-checks
runs-on: ubuntu-24.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
allow_skipped_tests: true