Skip to content

Commit

Permalink
Merge pull request CVMix#96 from mnlevy1981/updateCI
Browse files Browse the repository at this point in the history
Use github actions for testing
  • Loading branch information
mnlevy1981 authored Aug 15, 2024
2 parents 3ec78ba + 71d339b commit eba2b7f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 30 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/run_test_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CVMix CI
on: [push, pull_request]
jobs:
CVMix-Testing:
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- 3.9

steps:
- uses: actions/checkout@v3

- name: Load Environment
run: |
sudo apt-get update
sudo apt install make gfortran netcdf-bin libnetcdf-dev libnetcdff-dev openmpi-bin libopenmpi-dev
- name: Run Test Suite
run: |
./reg_tests/common/setup_inputdata.sh
cd bld
./cvmix_setup gfortran $(dirname $(dirname $(which nc-config)))
cd ../CVMix_tools
./run_test_suite.sh --already-ran-setup
cd ../reg_tests/Bryan-Lewis/
./Bryan-Lewis-test.sh --cmake
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

17 changes: 12 additions & 5 deletions reg_tests/common/check_inputdata.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#!/bin/bash
#!/bin/bash -e

check_inputdata () {

DATA_REPO=https://github.com/CVMix/CVMix-data/trunk/

cd ${INPUTDATA_DIR}
ALL_FOUND=TRUE
for file in "$@"; do
echo "Looking for $file..."
if [ -e ${INPUTDATA_DIR}/$file ]; then
if [ -e $file ]; then
echo "Found!"
else
svn export ${DATA_REPO}/$file ${INPUTDATA_DIR}/$file
echo "... Downloaded!"
echo "${file}" >> .git/info/sparse-checkout
ALL_FOUND=FALSE
echo "... added to sparse-checkout!"
fi
done

}
if [ "${ALL_FOUND}" == "FALSE" ]; then
git checkout master
fi

}
9 changes: 9 additions & 0 deletions reg_tests/common/setup_inputdata.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e
# Since github dropped support for svn hooks, now need to set up
# a sparse checkout to get inputdata.
# NOTE: this script must be run from ${CVMIX_ROOT}!

cd inputdata
git init
git config core.sparseCheckout true
git remote add -f CVMix-data https://github.com/CVMix/CVMix-data.git
5 changes: 3 additions & 2 deletions reg_tests/tidal-Simmons/Simmons-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

# (1) Load required routines
. ../common/environ.sh
Expand All @@ -20,7 +20,8 @@ PHYS_FILE=gx1v6_physics_130523.nc
ENERGY_FILE=tidal_energy_gx1v6_20130512.nc

# Input Data repository (currently using "svn export")
check_inputdata $GRID_FILE $PHYS_FILE $ENERGY_FILE
# (run in subshell because check_inputdata changes directory)
(check_inputdata $GRID_FILE $PHYS_FILE $ENERGY_FILE)

# If different inputdata directory specified, update namelist
if [ "$INPUTDATA_DIR" != "$CVMix/inputdata" ]; then
Expand Down
3 changes: 1 addition & 2 deletions src/shared/cvmix_tidal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ subroutine cvmix_coeffs_tidal_wrap(CVmix_vars, &
CVmix_vars%SimmonsCoeff, &
CVmix_vars%VertDep_iface, nlev, max_nlev, &
CVMix_params, &
CVmix_vars%SchmittnerSouthernOcean, &
CVmix_tidal_params_user)
CVMix_tidal_params_user=CVmix_tidal_params_user)
case ('schmittner','Schmittner')
call cvmix_coeffs_tidal_schmittner &
(new_Mdiff, new_Tdiff, &
Expand Down

0 comments on commit eba2b7f

Please sign in to comment.