Skip to content

Commit

Permalink
Add test to disable MICM and/or TUVX (#220)
Browse files Browse the repository at this point in the history
* relocate util test inside  tuvx

* move test into github actions

* fix matrix options

* add a space

* line breaker

* add a check to exclude gcc 13 and tuvx combination

* add the check
  • Loading branch information
boulderdaze authored Sep 23, 2024
1 parent a316b0d commit efa9857
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- { cpp: g++-14, c: gcc-14, fc: gfortran-14}
- { cpp: clang++, c: clang, fc: gfortran-12}
options:
- {python: ON, tuvx: OFF}
- {python: OFF, tuvx: ON}
- {micm: ON, tuvx: OFF, python: ON}
- {micm: OFF, tuvx: ON, python: OFF}
build_type: [Release]
env:
CC: ${{ matrix.compiler.c }}
Expand All @@ -40,13 +40,22 @@ jobs:
sudo apt-get install -y liblapack-dev libblas-dev build-essential libnetcdf-dev libnetcdff-dev
sudo apt-get install -y python3-numpy
- name: Run Cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D MUSICA_GIT_TAG=${{ github.sha }} -D MUSICA_ENABLE_PYTHON_LIBRARY=${{ matrix.options.python }} -D MUSICA_ENABLE_TUVX=${{ matrix.matrix.options.tuvx }}
- name: Run Cmake
# TUV-x doesn't work with gcc 13
if: matrix.compiler.fc != 'gfortran-13' && matrix.options.tuvx != 'ON'
run: |
cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D MUSICA_GIT_TAG=${{ github.sha }} \
-D MUSICA_ENABLE_MICM=${{ matrix.options.micm }} \
-D MUSICA_ENABLE_TUVX=${{ matrix.options.tuvx }} \
-D MUSICA_ENABLE_PYTHON_LIBRARY=${{ matrix.options.python }}
- name: Build
if: matrix.compiler.fc != 'gfortran-13' && matrix.options.tuvx != 'ON'
run: cmake --build build --verbose

- name: Run tests
if: matrix.compiler.fc != 'gfortran-13' && matrix.options.tuvx != 'ON'
run: |
cd build
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose
Expand Down
3 changes: 1 addition & 2 deletions fortran/test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include(test_util)

create_standard_test_fortran(NAME fortran_util SOURCES util.F90)

if (MUSICA_ENABLE_MICM)
create_standard_test_fortran(NAME micm_fortran_api SOURCES ../fetch_content_integration/test_micm_api.F90)
create_standard_test_fortran(NAME get_micm_version SOURCES ../fetch_content_integration/test_get_micm_version.F90)
Expand All @@ -10,6 +8,7 @@ if (MUSICA_ENABLE_MICM)
endif()

if (MUSICA_ENABLE_TUVX)
create_standard_test_fortran(NAME fortran_util SOURCES util.F90)
create_standard_test_fortran(NAME connect_to_tuvx SOURCES tuvx.F90)
create_standard_test_fortran(NAME tuvx_fortran_api SOURCES ../fetch_content_integration/test_tuvx_api.F90)

Expand Down

0 comments on commit efa9857

Please sign in to comment.