Closed dafyddstephenson closed 3 months ago
Hi again @nmolem , I finally got what we discussed yesterday working. The logs are now printed in a separate step of the Actions workflow, but only in the case where the tests fail. The trimmed down input data are at https://github.com/dafyddstephenson/ucla_roms_examples_input_data . Again, I can transfer ownership of this repository to CESR-lab, but I imagine using github to host the files will just be a temporary measure. I think we're ready to merge.
Hi all, This PR allows automated testing when code is pushed to GitHub. You can see an example here. This primarily involves the addition of files used by the GitHub runner (VM) handling the testing, but also includes some modifications to the test cases themselves.
Modifications related to CI
Examples/*/code_check
:input_data
symlink has been converted to a relative pathbenchmark.result_github
: output log to be compared with when run by GitHubExamples/bgc_real/code_check
: added this directory to includebgc_real
in the test suiteExamples/bgc_real/code_check/do_test_roms.sh
: a modified version ofExamples/code_check/do_test_roms.sh
which loops overBGC_MODEL in {"BEC","MARBL"}
, testing thebgc_real
example with either BGC model.Examples/bgc_real/code_check/cppdefs_{BEC,MARBL}.opt
: for compiling and running the test with either BGC model.Examples/bgc_real/marbl_in
: configuration file for when running test with MARBLExamples/code_check/do_test_all.sh
: Addedbgc_real
case, added exit codes, addedgithub
to argument listExamples/code_check/do_test_roms.sh
: Addedgithub
to argument listNew files related to CI
.github/workflows/automated_testing_workflow.yml
: contains step-by-step commands to compile ROMS and run its test suite on a GitHub runner with Ubuntuci/environment.yml
: used to create a conda environment on the GitHub runner in which to compile ROMSci/get_input_files.sh
: used by the GitHub runner to fetchinput_data
files for Example cases. In particular, line 10:URL_PREFIX="https://github.com/dafyddstephenson/ucla_roms_examples_input_data/raw/main"
points to a location where I've hosted (using git lfs) the files such that they can be accessed withwget
andcurl
. I can transfer ownership of this repo toCESR-lab
or we can changeURL_PREFIX
after finding somewhere else suitable to host the data. Please note that the bgc input files have been modified to ensure compatibility with both BEC and MARBL. In the forcing file, I have set a constant NOx forcing at 1e-13 kg/m2/s and a constant NHy forcing at 1e-12 kg/m2/s, and addedpco2_air_alt
to take the same values aspco2_air
. In the initial and boundary files I have created and set any variables required by MARBL but not BEC to be 0 everywhere.ci/set_environ.sh
: can be used for testing on GitHub codespaces, VMs hosted by GitHub that are similar to interactive GitHub runnersci/ci_makefiles
: alternative Makefiles that allow the GitHub runner to compile using gfortranUnrelated bugfix
main.F
: Lastly, there is a bugfix inmain.F
setting the call order ofinit_tracers
andinit_scalars
based on whether the user is running with BEC. Ifinit_scalars
comes first then the various BGC tracer indices (e.g.iPO4
) are at their default value of 0, causing a runtime error. The output is otherwise unaffected.Appreciate that there's a lot here so happy to discuss in the comments! Dafydd