Align update of nextSIM-DG and XIOS calendars #301
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: 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 -DCMAKE_BUILD_TYPE=Release .. | |
make -j 4 | |
- name: installs for python tests | |
run: | | |
pip install numpy | |
pip install netCDF4 | |
- 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 | |
./run_test_jan2010_integration_test.sh python3 | |
test-ubuntu-mpi-noxios: | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build and compile with MPI but not XIOS | |
run: | | |
. /opt/spack-environment/activate.sh | |
mkdir -p build && cd build | |
cmake -DENABLE_MPI=ON -DENABLE_XIOS=OFF -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 | |
test-ubuntu-mpi-xios: | |
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 | |
test-mac-serial: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: installs | |
run: | | |
brew install boost | |
brew unlink pkg-config | |
brew install pkgconf | |
brew link --overwrite pkgconf | |
brew install cmake | |
brew install eigen | |
brew install netcdf | |
brew install netcdf-cxx | |
pip install netCDF4 | |
pip install numpy | |
# 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 -DCMAKE_BUILD_TYPE=Release -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 | |
./run_test_jan2010_integration_test.sh python |