Make unit testing optional and simplify test code #73
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
BUILD_DIR_PREFIX: _build | |
jobs: | |
gnu-openmpi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Setup GNU compiler | |
uses: fortran-lang/setup-fortran@v1 | |
with: | |
compiler: gcc | |
version: 13 | |
- name: Setup OpenMPI | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y openmpi-common openmpi-bin libopenmpi-dev | |
- name: Setup GNU/OpenMPI environment | |
run: | | |
echo "FC=${{ env.FC }}" >> ${GITHUB_ENV} | |
echo "FPM_FC=${{ env.FC }}" >> ${GITHUB_ENV} | |
- name: Setup build tools | |
run: | | |
pip install cookiecutter cmake meson ninja fpm | |
- name: Test CMake serial | |
run: | | |
./test/runners/test.cmake.sh serial fortuno ${BUILD_DIR_PREFIX}_cmake_serial_fortuno | |
# # CMake can not detect OpenMPI on Ubuntu 22.04 due to broken CMake export file | |
# - name: Test CMake MPI | |
# run: | | |
# ./test/runners/test.cmake.sh mpi fortuno ${BUILD_DIR_PREFIX}_cmake_mpi_fortuno | |
- name: Test Fpm serial | |
run: | | |
./test/runners/test.fpm.sh serial fortuno ${BUILD_DIR_PREFIX}_fpm_serial_fortuno | |
- name: Test Fpm MPI | |
run: | | |
./test/runners/test.fpm.sh mpi fortuno ${BUILD_DIR_PREFIX}_fpm_mpi_fortuno | |
- name: Test Meson serial | |
run: | | |
./test/runners/test.meson.sh serial fortuno ${BUILD_DIR_PREFIX}_meson_serial_fortuno | |
- name: Test Meson MPI | |
run: | | |
./test/runners/test.meson.sh mpi fortuno ${BUILD_DIR_PREFIX}_meson_mpi_fortuno | |
intel-impi: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Setup Intel/IntelMPI toolchain | |
uses: rscohn2/setup-oneapi@v0 | |
with: | |
components: | | |
ifx | |
impi | |
- name: Setup Intel/IntelMPI environment | |
run: | | |
source /opt/intel/oneapi/setvars.sh | |
printenv >> ${GITHUB_ENV} | |
echo "FC=ifx" >> ${GITHUB_ENV} | |
echo "FPM_FC=ifx" >> ${GITHUB_ENV} | |
- name: Setup build tools | |
run: | | |
pip install cookiecutter cmake meson ninja fpm | |
- name: Test CMake serial | |
run: | | |
./test/runners/test.cmake.sh serial fortuno ${BUILD_DIR_PREFIX}_cmake_serial_fortuno | |
- name: Test CMake MPI | |
run: | | |
./test/runners/test.cmake.sh mpi fortuno ${BUILD_DIR_PREFIX}_cmake_mpi_fortuno | |
- name: Test CMake coarray | |
run: > | |
FFLAGS_COARRAY="-coarray" | |
LDFLAGS_COARRAY="-coarray" | |
./test/runners/test.cmake.sh coarray fortuno ${BUILD_DIR_PREFIX}_cmake_coarray_fortuno | |
- name: Test Fpm serial | |
run: | | |
./test/runners/test.fpm.sh serial fortuno ${BUILD_DIR_PREFIX}_fpm_serial_fortuno | |
- name: Test Fpm MPI | |
# Workaround for IntelMPI: FPM uses compiler flags (-standard-semantics) which makes | |
# compiled binary incompatible with IntelMPI. Overriding with some dummy flags. | |
run: | | |
FPM_FFLAGS="-stand f18" ./test/runners/test.fpm.sh mpi fortuno ${BUILD_DIR_PREFIX}_fpm_mpi_fortuno | |
- name: Test Fpm coarray | |
run: > | |
FFLAGS_COARRAY="-coarray" | |
LDFLAGS_COARRAY="-coarray" | |
./test/runners/test.fpm.sh coarray fortuno ${BUILD_DIR_PREFIX}_fpm_coarray_fortuno | |
- name: Test Meson serial | |
run: | | |
./test/runners/test.meson.sh serial fortuno ${BUILD_DIR_PREFIX}_meson_serial_fortuno | |
# # Meson can not detect IntelMPI properly | |
# - name: Test Meson MPI | |
# run: | | |
# ./test/runners/test.meson-mpi.sh ${BUILD_DIR_PREFIX}_meson_mpi | |
- name: Test Meson coarray | |
run: > | |
FFLAGS_COARRAY="-coarray" | |
LDFLAGS_COARRAY="-coarray" | |
./test/runners/test.meson.sh coarray fortuno ${BUILD_DIR_PREFIX}_meson_coarray_fortuno |