Skip to content

Commit

Permalink
Add basic CI using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarusz committed Aug 24, 2023
1 parent 6dfe1d4 commit f8cc147
Show file tree
Hide file tree
Showing 12 changed files with 316 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/mmf-simplified-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: mmf-simplified-macos

on: [push, pull-request]

jobs:
mmf-simplified-macos:
runs-on: macos-12
strategy:
fail-fast: false
matrix:
compiler:
- clang
dycore:
- pamc
- pama
defaults:
run:
working-directory: standalone/mmf_simplified/build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install mpi and netcdf
run: brew install open-mpi netcdf

- name: Configure and build
run: |
source ../../machines/ci/macos-${{matrix.compiler}}.env &&
YAKL_CXX_FLAGS="${YAKL_CXX_FLAGS} -DYAKL_DEBUG"
./cmakescript_${{matrix.dycore}}.sh &&
cmake --build .
- name: Run driver
run: ./driver ../inputs/ci/input_${{matrix.dycore}}.yaml
36 changes: 36 additions & 0 deletions .github/workflows/mmf-simplified-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: mmf-simplified-ubuntu

on: [push, pull-request]

jobs:
mmf-simplified-ubuntu:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
dycore:
- pamc
- pama
defaults:
run:
working-directory: standalone/mmf_simplified/build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install mpi and netcdf
run: sudo apt-get install -y libopenmpi-dev libnetcdf-dev

- name: Configure and build
run: |
source ../../machines/ci/ubuntu-${{matrix.compiler}}.env &&
YAKL_CXX_FLAGS="${YAKL_CXX_FLAGS} -DYAKL_DEBUG"
./cmakescript_${{matrix.dycore}}.sh &&
cmake --build .
- name: Run driver
run: ./driver ../inputs/ci/input_${{matrix.dycore}}.yaml
48 changes: 48 additions & 0 deletions .github/workflows/pamc-idealized-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: pamc-idealized-ubuntu

on: [push, pull-request]

jobs:
pamc-idealized-ubuntu:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- model: layermodel
hamiltonian: swe
thermo: none
- model: layermodel
hamiltonian: tswe
thermo: none
- model: extrudedmodel
hamiltonian: ce
thermo: idealgaspottemp
- model: extrudedmodel
hamiltonian: ce
thermo: idealgasentropy
- model: extrudedmodel
hamiltonian: an
thermo: idealgaspottemp
- model: extrudedmodel
hamiltonian: mce_rho
thermo: constkappavirpottemp
- model: extrudedmodel
hamiltonian: man
thermo: constkappavirpottemp
defaults:
run:
working-directory: standalone/idealized/build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install mpi and netcdf
run: sudo apt-get install -y libopenmpi-dev libnetcdf-dev

- name: Configure and build
run: |
source ../../machines/ci/ubuntu-gcc.env &&
./cmakescript_pamc.sh ${{matrix.model}} ${{matrix.hamiltonian}} ${{matrix.thermo}} &&
cmake --build .
31 changes: 31 additions & 0 deletions .github/workflows/pamc-unit-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pamc-unit-macos

on: [push, pull-request]

jobs:
pamc-unit-macos:
runs-on: macos-12
strategy:
fail-fast: false
matrix:
compiler:
- clang
defaults:
run:
working-directory: dynamics/spam/test/build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install mpi and netcdf
run: brew install open-mpi netcdf

- name: Configure and build
run: |
source ../../../../standalone/machines/ci/macos-${{matrix.compiler}}.env &&
./cmakescript.sh &&
cmake --build .
- name: Run tests
run: ctest --output-on-failure
32 changes: 32 additions & 0 deletions .github/workflows/pamc-unit-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: pamc-unit-ubuntu

on: [push, pull-request]

jobs:
pamc-unit-ubuntu:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
defaults:
run:
working-directory: dynamics/spam/test/build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install mpi and netcdf
run: sudo apt-get install -y libopenmpi-dev libnetcdf-dev

- name: Configure and build
run: |
source ../../../../standalone/machines/ci/ubuntu-${{matrix.compiler}}.env &&
./cmakescript.sh &&
cmake --build .
- name: Run tests
run: ctest --output-on-failure
1 change: 0 additions & 1 deletion dynamics/spam/test/build/cmakescript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
./cmakeclean.sh

cmake \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_CUDA_HOST_COMPILER=${CXX} \
-DYAKL_CUDA_FLAGS="${YAKL_CUDA_FLAGS}" \
-DYAKL_CXX_FLAGS="${YAKL_CXX_FLAGS}" \
Expand Down
10 changes: 7 additions & 3 deletions standalone/idealized/build/cmakescript_pamc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

./cmakeclean.sh

ARG1=${1:-"extrudedmodel"}
ARG2=${2:-"man"}
ARG3=${3:-"constkappavirpottemp"}

cmake \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_CUDA_HOST_COMPILER=${CXX} \
Expand All @@ -17,8 +21,8 @@ cmake \
-DPAM_MICRO="none" \
-DPAM_SGS="none" \
-DPAM_RAD="none" \
-DPAMC_MODEL="extrudedmodel" \
-DPAMC_HAMIL="man" \
-DPAMC_THERMO="constkappavirpottemp" \
-DPAMC_MODEL=$ARG1 \
-DPAMC_HAMIL=$ARG2 \
-DPAMC_THERMO=$ARG3 \
-DPAMC_IO="serial" \
..
21 changes: 21 additions & 0 deletions standalone/machines/ci/macos-clang.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export YAKL_ARCH=
unset CXXFLAGS
unset FFLAGS
unset F77FLAGS
unset F90FLAGS

export CC=mpicc
export CXX=mpic++
export FC=mpifort

export OMPI_CC=clang
export OMPI_CXX=clang++
export OMPI_FC=gfortran-12

export YAKL_CXX_FLAGS="-DHAVE_MPI -O2 -I`nc-config --includedir`"
export YAKL_F90_FLAGS="-O2 -ffree-line-length-none"
export PAM_LINK_FLAGS="-L`nc-config --libdir` -lnetcdf"
export PAM_NLEV=50
export PAM_SCREAM_USE_CXX="OFF"
21 changes: 21 additions & 0 deletions standalone/machines/ci/ubuntu-clang.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export YAKL_ARCH=
unset CXXFLAGS
unset FFLAGS
unset F77FLAGS
unset F90FLAGS

export CC=mpicc
export CXX=mpic++
export FC=mpifort

export OMPI_CC=clang
export OMPI_CXX=clang++
export OMPI_FC=gfortran

export YAKL_CXX_FLAGS="-DHAVE_MPI -O2 -I`nc-config --includedir`"
export YAKL_F90_FLAGS="-O2 -ffree-line-length-none"
export PAM_LINK_FLAGS="-L`nc-config --libdir` -lnetcdf"
export PAM_NLEV=50
export PAM_SCREAM_USE_CXX="OFF"
21 changes: 21 additions & 0 deletions standalone/machines/ci/ubuntu-gcc.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export YAKL_ARCH=
unset CXXFLAGS
unset FFLAGS
unset F77FLAGS
unset F90FLAGS

export CC=mpicc
export CXX=mpic++
export FC=mpifort

export OMPI_CC=gcc
export OMPI_CXX=g++
export OMPI_FC=gfortran

export YAKL_CXX_FLAGS="-DHAVE_MPI -O2 -I`nc-config --includedir`"
export YAKL_F90_FLAGS="-O2 -ffree-line-length-none"
export PAM_LINK_FLAGS="-L`nc-config --libdir` -lnetcdf"
export PAM_NLEV=50
export PAM_SCREAM_USE_CXX="OFF"
36 changes: 36 additions & 0 deletions standalone/mmf_simplified/inputs/ci/input_pama.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
simTime : 1800 # 2 GCM time steps

# Number of cells to use in the CRMs
crm_nx : 65
crm_ny : 1

# Number of CRMs
nens : 1

# Vertical height cooridnates file
vcoords : vcoords_equal_50_20km.nc

# Domain size of the CRMs
xlen : 128000
ylen : 64000

weno_scalars : true

weno_winds : true

initData : supercell

# Output filename
out_prefix : test_pama

# GCM time step
dt_gcm: 900

# CRM physics time step
dt_crm_phys: 20.

# Output frequency in seconds
out_freq: 200.


28 changes: 28 additions & 0 deletions standalone/mmf_simplified/inputs/ci/input_pamc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
simTime : 1800 # 2 GCM time steps

# Number of cells to use in the CRMs
crm_nx : 65
crm_ny : 1

# Number of CRMs
nens : 1

# Vertical height cooridnates file
vcoords : vcoords_equal_50_20km.nc

# Domain size of the CRMs
xlen : 128000
ylen : 64000

# Output filename
out_prefix : test_pamc

# GCM time step
dt_gcm: 900

# CRM physics time step
dt_crm_phys: 20.

# Output frequency in seconds
out_freq: 200.

0 comments on commit f8cc147

Please sign in to comment.