3333 schedule :
3434 # * is a special character in YAML so you have to quote this string
3535 - cron : " 0 8 * * *"
36- # runs on all branches on both RMG-Py and forks
37- push :
36+ # allow running on RMG-Py on a pushed branch, only if triggered manually
37+ workflow_dispatch :
3838 # runs on PRs against RMG-Py (and anywhere else, but we add this for RMG-Py)
3939 pull_request :
4040
4848 # if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace
4949 # main with the name of the branch
5050 RMG_DATABASE_BRANCH : main
51-
51+ # julia parallel pre-compilation leads to race conditions and hangs, so we limit it to run in serial
52+ JULIA_NUM_PRECOMPILE_TASKS : 1
5253
5354jobs :
54- build-osx :
55- runs-on : macos-13
55+ build-and-test :
56+ strategy :
57+ fail-fast : false
58+ matrix :
59+ python-version : ["3.9"]
60+ os : [macos-13, macos-latest, ubuntu-latest]
61+ include-rms : ["", "with RMS"]
62+ exclude :
63+ - os : macos-13 # GitHub's runners just aren't up to the task of installing Julia
64+ include-rms : ' with RMS'
65+ runs-on : ${{ matrix.os }}
66+ name : Python ${{ matrix.python-version }} ${{ matrix.os }} Build and Test ${{ matrix.include-rms }}
5667 # skip scheduled runs from forks
5768 if : ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
5869 defaults :
@@ -62,55 +73,56 @@ jobs:
6273 - name : Checkout RMG-Py
6374 uses : actions/checkout@v4
6475
65- # Step to create a custom condarc.yml before setting up conda
66- - name : Create custom conda config file
67- run : |
68- RUNNER_CWD=$(pwd)
69- echo "channels:" > $RUNNER_CWD/condarc.yml
70- echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
71- echo " - rmg" >> $RUNNER_CWD/condarc.yml
72- echo " - cantera" >> $RUNNER_CWD/condarc.yml
73- echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
74-
75- # configures the mamba environment manager and builds the environment
76- - name : Setup Miniforge Python 3.7
76+ - name : Setup Miniforge Python ${{ matrix.python-version }}
7777 uses : conda-incubator/setup-miniconda@v3
7878 with :
7979 environment-file : environment.yml
8080 miniforge-variant : Miniforge3
8181 miniforge-version : latest
82- python-version : 3.7
83- condarc-file : condarc.yml
82+ python-version : ${{ matrix.python-version }}
8483 activate-environment : rmg_env
85- use-mamba : true
84+ auto-update-conda : true
85+ show-channel-urls : true
86+ conda-remove-defaults : " true"
8687
8788 # list the environment for debugging purposes
88- - name : mamba info
89+ - name : conda info
8990 run : |
90- mamba info
91- mamba list
91+ conda info
92+ conda list
9293
9394 # Clone RMG-database
9495 - name : Clone RMG-database
9596 run : |
9697 cd ..
9798 git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
9899
99- # modify env variables as directed in the RMG installation instructions
100- - name : Set Environment Variables
101- run : |
102- RUNNER_CWD=$(pwd)
103- echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
104- echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH
105-
106100 # RMG build step
107- - name : make RMG
108- run : |
109- make clean
110- make
101+ - run : make install
102+
103+ - name : Setup Juliaup
104+ if : matrix.include-rms == 'with RMS'
105+ uses : julia-actions/install-juliaup@v2
106+ with :
107+ channel : ' 1.10'
108+
109+ # RMS installation and linking to Julia
110+ - name : Install and link Julia dependencies
111+ if : matrix.include-rms == 'with RMS'
112+ timeout-minutes : 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
113+ run : . install_rms.sh
114+
115+ - name : Install Q2DTor
116+ run : echo "" | make q2dtor
117+
118+ # non-regression testing
119+ - name : Run Unit, Functional, and Database Tests
120+ run : make test-all
111121
112- build-and-test-linux :
122+ regression-test :
123+ needs : build-and-test
113124 runs-on : ubuntu-latest
125+ name : Regression Test
114126 # skip scheduled runs from forks
115127 if : ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
116128 env :
@@ -123,76 +135,58 @@ jobs:
123135 - name : Checkout RMG-Py
124136 uses : actions/checkout@v4
125137
126- # Step to create a custom condarc.yml before setting up conda
127- - name : Create custom condarc.yml
128- run : |
129- RUNNER_CWD=$(pwd)
130- echo "channels:" > $RUNNER_CWD/condarc.yml
131- echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
132- echo " - rmg" >> $RUNNER_CWD/condarc.yml
133- echo " - cantera" >> $RUNNER_CWD/condarc.yml
134- echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml
135-
136- # configures the mamba environment manager and builds the environment
137- - name : Setup Miniforge Python 3.7
138+ - name : Setup Miniforge Python 3.9
138139 uses : conda-incubator/setup-miniconda@v3
139140 with :
140141 environment-file : environment.yml
141142 miniforge-variant : Miniforge3
142143 miniforge-version : latest
143- python-version : 3.7
144- condarc-file : condarc.yml
144+ python-version : 3.9
145145 activate-environment : rmg_env
146- use-mamba : true
146+ auto-update-conda : true
147+ show-channel-urls : true
148+ conda-remove-defaults : " true"
147149
148150 # list the environment for debugging purposes
149- - name : mamba info
151+ - name : conda info
150152 run : |
151- mamba info
152- mamba list
153+ conda info
154+ conda list
153155
154156 # Clone RMG-database
155157 - name : Clone RMG-database
156158 run : |
157159 cd ..
158160 git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
159161
160- # modify env variables as directed in the RMG installation instructions
161- - name : Set Environment Variables
162- run : |
163- RUNNER_CWD=$(pwd)
164- echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
165- echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH
166-
167162 # RMG build step
168- - name : make RMG
163+ - run : make install
164+
165+ - name : Make separate No-RMS conda env
169166 run : |
170- make clean
171- make
167+ conda create --name rmg_env_without_rms --clone rmg_env
168+
169+ - name : Setup Juliaup
170+ uses : julia-actions/install-juliaup@v2
171+ with :
172+ channel : ' 1.10'
172173
173174 # RMS installation and linking to Julia
174175 - name : Install and link Julia dependencies
175176 timeout-minutes : 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
176177 run : |
177- python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
178- julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'
178+ . install_rms.sh
179179
180180 - name : Install Q2DTor
181181 run : echo "" | make q2dtor
182182
183- # non-regression testing
184- - name : Run Unit, Functional, and Database Tests
185- # aggregate into one command so we only have to eat the collection time once
186- run : make test-all
187-
188183 # Regression Testing - Test Execution
189184 - name : Regression Tests - Execution
190185 id : regression-execution
191- timeout-minutes : 60
192186 run : |
193187 for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation RMS_liquidSurface_ch4o2cat fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
194188 do
195- if python-jl rmg.py test/regression/"$regr_test"/input.py; then
189+ if python rmg.py test/regression/"$regr_test"/input.py; then
196190 echo "$regr_test" "Executed Successfully"
197191 else
198192 echo "$regr_test" "Failed to Execute" | tee -a $GITHUB_STEP_SUMMARY
@@ -264,7 +258,10 @@ jobs:
264258 env :
265259 REFERENCE : stable_regression_results
266260 run : |
261+ conda activate rmg_env_without_rms
262+
267263 exec 2> >(tee -a regression.stderr >&2) 1> >(tee -a regression.stdout)
264+ touch checkModels.log
268265 mkdir -p "test/regression-diff"
269266 for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
270267 do
@@ -282,12 +279,12 @@ jobs:
282279
283280 echo "<details>"
284281 # Compare the edge and core
285- if python-jl scripts/checkModels.py \
282+ if python scripts/checkModels.py \
286283 "$regr_test-core" \
287284 $REFERENCE/"$regr_test"/chemkin/chem_annotated.inp \
288285 $REFERENCE/"$regr_test"/chemkin/species_dictionary.txt \
289286 test/regression/"$regr_test"/chemkin/chem_annotated.inp \
290- test/regression/"$regr_test"/chemkin/species_dictionary.txt
287+ test/regression/"$regr_test"/chemkin/species_dictionary.txt &> checkModels.log
291288 then
292289 echo "<summary>$regr_test Passed Core Comparison ✅</summary>"
293290 else
@@ -299,12 +296,12 @@ jobs:
299296 cat "$regr_test-core.log" || (echo "Dumping the whole log failed, please download it from GitHub actions. Here are the first 100 lines:" && head -n100 "$regr_test-core.log")
300297 echo "</details>"
301298 echo "<details>"
302- if python-jl scripts/checkModels.py \
299+ if python scripts/checkModels.py \
303300 "$regr_test-edge" \
304301 $REFERENCE/"$regr_test"/chemkin/chem_edge_annotated.inp \
305302 $REFERENCE/"$regr_test"/chemkin/species_edge_dictionary.txt \
306303 test/regression/"$regr_test"/chemkin/chem_edge_annotated.inp \
307- test/regression/"$regr_test"/chemkin/species_edge_dictionary.txt
304+ test/regression/"$regr_test"/chemkin/species_edge_dictionary.txt &> checkModels.log
308305 then
309306 echo "<summary>$regr_test Passed Edge Comparison ✅</summary>"
310307 else
@@ -320,10 +317,10 @@ jobs:
320317 if [ -f test/regression/"$regr_test"/regression_input.py ];
321318 then
322319 echo "<details>"
323- if python-jl rmgpy/tools/regression.py \
320+ if python rmgpy/tools/regression.py \
324321 test/regression/"$regr_test"/regression_input.py \
325322 $REFERENCE/"$regr_test"/chemkin \
326- test/regression/"$regr_test"/chemkin
323+ test/regression/"$regr_test"/chemkin &> checkModels.log
327324 then
328325 echo "<summary>$regr_test Passed Observable Testing ✅</summary>"
329326 else
@@ -352,6 +349,11 @@ jobs:
352349 cat regression.stdout >> summary.txt
353350 echo "</details>" >> summary.txt
354351 echo "" >> summary.txt
352+ echo "<details>" >> summary.txt
353+ echo "<summary>Debugging info for `checkModels.py` (if any).</summary>" >> summary.txt
354+ cat checkModels.log >> summary.txt
355+ echo "</details>" >> summary.txt
356+ echo "" >> summary.txt
355357 echo "_beep boop this comment was written by a bot_ :robot:" >> summary.txt
356358 cat summary.txt > $GITHUB_STEP_SUMMARY
357359
@@ -374,7 +376,7 @@ jobs:
374376 - name : Code coverage install and run
375377 if : success() || ( failure() && steps.regression-execution.conclusion == 'success' )
376378 run : |
377- mamba install -y -c conda-forge codecov
379+ conda install -y -c conda-forge codecov
378380 codecov
379381
380382 build-and-push-docker :
@@ -384,7 +386,7 @@ jobs:
384386 # who knows ¯\_(ツ)_/¯
385387 #
386388 # taken from https://github.com/docker/build-push-action
387- needs : build-and- test-linux
389+ needs : regression- test
388390 runs-on : ubuntu-latest
389391 if : github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py'
390392 steps :
0 commit comments