Issue459 oasis ocean coupling #46
This file contains hidden or 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: compile code and tests | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
test-ubuntu-serial: | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build and compile without XIOS or MPI | |
run: | | |
. /opt/spack-environment/activate.sh | |
mkdir -p build && cd build | |
cmake .. | |
make -j 4 | |
- name: run serial tests | |
run: | | |
. /opt/spack-environment/activate.sh | |
apt update | |
apt install -y wget | |
cd build | |
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc") | |
for component in core physics dynamics | |
do | |
cd $component/test | |
for file in $(find test* -maxdepth 0 -type f) | |
do | |
echo $file | |
./$file | |
done | |
cd - | |
done | |
mv ../test . | |
cd test | |
python3 ThermoIntegration_test.py | |
cd - | |
test-ubuntu-mpi: | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build and compile with XIOS and MPI | |
run: | | |
. /opt/spack-environment/activate.sh | |
mkdir -p build && cd build | |
cmake -DENABLE_MPI=ON -Dxios_DIR="/xios" -DENABLE_XIOS=ON -DCMAKE_CXX_COMPILER="$(which mpic++)" .. | |
make -j 4 | |
- name: run MPI tests | |
run: | | |
. /opt/spack-environment/activate.sh | |
apt update | |
apt install -y wget | |
cd build | |
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc") | |
for component in core physics dynamics | |
do | |
cd $component/test | |
for file in $(find test* -maxdepth 0 -type f) | |
do | |
echo $file | |
nprocs=$(echo $file | sed -r "s/.*MPI([0-9]+)/\1/") | |
mpirun --allow-run-as-root --oversubscribe -n $nprocs ./$file | |
done | |
cd - | |
done | |
cd - | |
test-mac-serial: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: installs | |
run: | | |
brew install netcdf | |
brew install netcdf-cxx | |
brew install boost | |
brew install eigen | |
brew install cmake | |
pip install numpy | |
pip install netCDF4 | |
# tmate can be used to get an interactive ssh session to the github runner | |
# for debugging actions. See | |
# [here](https://github.com/mxschmitt/action-tmate) for more information. | |
# uncomment these lines to debug mac build | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
- name: make | |
run: | | |
mkdir -p build | |
cd build | |
# added Python_ROOT_DIR to help cmake find correct Python in the mac VM | |
cmake -DENABLE_MPI=OFF -DENABLE_XIOS=OFF -DPython_ROOT_DIR=/Library/Frameworks/Python.framework/Versions/Current/bin .. | |
make -j 4 | |
- name: run serial tests | |
run: | | |
cd build | |
for component in core physics dynamics | |
do | |
cd $component/test | |
for file in $(find test* -maxdepth 0 -type f | grep -v "_MPI\d*$") | |
do | |
echo $file | |
./$file | |
done | |
cd - | |
done | |
mv ../test . | |
cd test | |
python ThermoIntegration_test.py | |
cd - |