Skip to content

Commit 1cf53fa

Browse files
committed
TEMPORARY! only run the docker build target in CI
To save time while debugging.
1 parent c86a443 commit 1cf53fa

1 file changed

Lines changed: 0 additions & 343 deletions

File tree

.github/workflows/CI.yml

Lines changed: 0 additions & 343 deletions
Original file line numberDiff line numberDiff line change
@@ -52,353 +52,10 @@ env:
5252
JULIA_NUM_PRECOMPILE_TASKS: 1
5353

5454
jobs:
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 }}
67-
# skip scheduled runs from forks
68-
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
69-
defaults:
70-
run:
71-
shell: bash -l {0}
72-
steps:
73-
- name: Checkout RMG-Py
74-
uses: actions/checkout@v4
75-
76-
- name: Setup Miniforge Python ${{ matrix.python-version }}
77-
uses: conda-incubator/setup-miniconda@v3
78-
with:
79-
environment-file: environment.yml
80-
miniforge-variant: Miniforge3
81-
miniforge-version: latest
82-
python-version: ${{ matrix.python-version }}
83-
activate-environment: rmg_env
84-
auto-update-conda: true
85-
show-channel-urls: true
86-
conda-remove-defaults: "true"
87-
88-
# list the environment for debugging purposes
89-
- name: conda info
90-
run: |
91-
conda info
92-
conda list
93-
94-
# Clone RMG-database
95-
- name: Clone RMG-database
96-
run: |
97-
cd ..
98-
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
99-
100-
# RMG build step
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
121-
122-
regression-test:
123-
runs-on: ubuntu-latest
124-
name: Regression Test
125-
# skip scheduled runs from forks
126-
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
127-
env:
128-
# This is true only if this is a reference case for the regression testing:
129-
REFERENCE_JOB: ${{ github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }}
130-
defaults:
131-
run:
132-
shell: bash -l {0}
133-
steps:
134-
- name: Checkout RMG-Py
135-
uses: actions/checkout@v4
136-
137-
- name: Setup Miniforge Python 3.9
138-
uses: conda-incubator/setup-miniconda@v3
139-
with:
140-
environment-file: environment.yml
141-
miniforge-variant: Miniforge3
142-
miniforge-version: latest
143-
python-version: 3.9
144-
activate-environment: rmg_env
145-
auto-update-conda: true
146-
show-channel-urls: true
147-
conda-remove-defaults: "true"
148-
149-
# list the environment for debugging purposes
150-
- name: conda info
151-
run: |
152-
conda info
153-
conda list
154-
155-
# Clone RMG-database
156-
- name: Clone RMG-database
157-
run: |
158-
cd ..
159-
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
160-
161-
# RMG build step
162-
- run: make install
163-
164-
- name: Make separate No-RMS conda env
165-
run: |
166-
conda create --name rmg_env_without_rms --clone rmg_env
167-
168-
- name: Setup Juliaup
169-
uses: julia-actions/install-juliaup@v2
170-
with:
171-
channel: '1.10'
172-
173-
# RMS installation and linking to Julia
174-
- name: Install and link Julia dependencies
175-
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
176-
run: |
177-
. install_rms.sh
178-
179-
- name: Install Q2DTor
180-
run: echo "" | make q2dtor
181-
182-
# Regression Testing - Test Execution
183-
- name: Regression Tests - Execution
184-
id: regression-execution
185-
run: |
186-
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;
187-
do
188-
if python rmg.py test/regression/"$regr_test"/input.py; then
189-
echo "$regr_test" "Executed Successfully"
190-
else
191-
echo "$regr_test" "Failed to Execute" | tee -a $GITHUB_STEP_SUMMARY
192-
export FAILED=Yes
193-
fi
194-
done
195-
if [[ ${FAILED} ]]; then
196-
echo "One or more regression tests could not be executed." | tee -a $GITHUB_STEP_SUMMARY
197-
echo "Please download the failed results or check the above log to see why." | tee -a $GITHUB_STEP_SUMMARY
198-
exit 1
199-
fi
200-
201-
# Upload Regression Results as Failed if above step failed
202-
- name: Upload Failed Results
203-
if: ${{ failure() && steps.regression-execution.conclusion == 'failure' }}
204-
uses: actions/upload-artifact@v4
205-
with:
206-
name: failed_regression_results
207-
path: |
208-
test/regression
209-
210-
# Upload Regression Results as Stable if Scheduled or Push to Main
211-
- name: Upload Results as Reference
212-
# upload the results for scheduled CI (on main) and pushes to main
213-
if: ${{ env.REFERENCE_JOB == 'true' }}
214-
uses: actions/upload-artifact@v4
215-
with:
216-
name: stable_regression_results
217-
path: |
218-
test/regression
219-
220-
# Upload Regression Results as Dynamic if Push to non-main Branch
221-
- name: Upload Results as Dynamic
222-
if: ${{ env.REFERENCE_JOB == 'false' }}
223-
uses: actions/upload-artifact@v4
224-
with:
225-
name: dynamic_regression_results
226-
path: |
227-
test/regression
228-
229-
- name: mkdir stable_regression_results
230-
if: ${{ env.REFERENCE_JOB == 'false' }}
231-
run: mkdir stable_regression_results
232-
233-
# Retrieve Stable Results for reference
234-
- name: Find ID of Reference Results
235-
env:
236-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
237-
# this will search for the last successful execution of CI on main
238-
run: |
239-
run_id=$(gh run list -R ReactionMechanismGenerator/RMG-Py --workflow="Continuous Integration" --branch main --limit 15 --json databaseId,conclusion --jq 'map(select(.conclusion == "success")) | .[0].databaseId')
240-
if [ -z "$run_id" ] || [ "$run_id" = "null" ]; then
241-
echo "::error::No successful reference run found"
242-
exit 1
243-
fi
244-
echo "CI_RUN_ID=$run_id" >> $GITHUB_ENV
245-
246-
- name: Retrieve Stable Regression Results
247-
if: ${{ env.REFERENCE_JOB == 'false' }}
248-
uses: actions/download-artifact@v4
249-
with:
250-
# download stable regression results
251-
run-id: ${{ env.CI_RUN_ID }}
252-
repository: ReactionMechanismGenerator/RMG-Py
253-
github-token: ${{ secrets.GITHUB_TOKEN }}
254-
name: stable_regression_results
255-
path: stable_regression_results
256-
257-
# Regression Testing - Actual Comparisons
258-
- name: Regression Tests - Compare to Baseline
259-
id: regression-comparison
260-
if: ${{ env.REFERENCE_JOB == 'false' }}
261-
env:
262-
REFERENCE: stable_regression_results
263-
run: |
264-
conda activate rmg_env_without_rms
265-
266-
exec 2> >(tee -a regression.stderr >&2) 1> >(tee -a regression.stdout)
267-
mkdir -p "test/regression-diff"
268-
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
269-
do
270-
echo ""
271-
echo "### Regression test $regr_test:"
272-
# Memory Usage and Execution Time
273-
echo -n 'Reference: '
274-
grep "Execution time" $REFERENCE/"$regr_test"/RMG.log | tail -1
275-
echo -n 'Current: '
276-
grep "Execution time" test/regression/"$regr_test"/RMG.log | tail -1
277-
echo -n 'Reference: '
278-
grep "Memory used:" $REFERENCE/"$regr_test"/RMG.log | tail -1
279-
echo -n 'Current: '
280-
grep "Memory used:" test/regression/"$regr_test"/RMG.log | tail -1
281-
282-
echo "<details>"
283-
# Compare the edge and core
284-
if python scripts/checkModels.py \
285-
"$regr_test-core" \
286-
$REFERENCE/"$regr_test"/chemkin/chem_annotated.inp \
287-
$REFERENCE/"$regr_test"/chemkin/species_dictionary.txt \
288-
test/regression/"$regr_test"/chemkin/chem_annotated.inp \
289-
test/regression/"$regr_test"/chemkin/species_dictionary.txt &> checkModels.err
290-
then
291-
echo "<summary>$regr_test Passed Core Comparison ✅</summary>"
292-
else
293-
echo "<summary>$regr_test Failed Core Comparison ❌</summary>"
294-
cp "$regr_test-core.log" test/regression-diff/
295-
export FAILED=Yes
296-
fi
297-
echo "" # blank line so next block is interpreted as markdown
298-
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")
299-
echo "</details>"
300-
if [ -s checkModels.err ]; then
301-
echo "<details>"
302-
echo "<summary>Errors occurred during core comparison ⚠️</summary>"
303-
cat checkModels.err
304-
echo "</details>"
305-
fi
306-
echo "<details>"
307-
if python scripts/checkModels.py \
308-
"$regr_test-edge" \
309-
$REFERENCE/"$regr_test"/chemkin/chem_edge_annotated.inp \
310-
$REFERENCE/"$regr_test"/chemkin/species_edge_dictionary.txt \
311-
test/regression/"$regr_test"/chemkin/chem_edge_annotated.inp \
312-
test/regression/"$regr_test"/chemkin/species_edge_dictionary.txt &> checkModels.err
313-
then
314-
echo "<summary>$regr_test Passed Edge Comparison ✅</summary>"
315-
else
316-
echo "<summary>$regr_test Failed Edge Comparison ❌</summary>"
317-
cp "$regr_test-edge.log" test/regression-diff/
318-
export FAILED=Yes
319-
fi
320-
echo "" # blank line so next block is interpreted as markdown
321-
cat "$regr_test-edge.log" || (echo "Dumping the whole log failed, please download it from GitHub actions. Here are the first 100 lines:" && head -n100 "$regr_test-edge.log")
322-
echo "</details>"
323-
if [ -s checkModels.err ]; then
324-
echo "<details>"
325-
echo "<summary>Errors occurred during edge comparison ⚠️</summary>"
326-
cat checkModels.err
327-
echo "</details>"
328-
fi
329-
330-
# Check for Regression between Reference and Dynamic (skip superminimal)
331-
if [ -f test/regression/"$regr_test"/regression_input.py ];
332-
then
333-
echo "<details>"
334-
if python rmgpy/tools/regression.py \
335-
test/regression/"$regr_test"/regression_input.py \
336-
$REFERENCE/"$regr_test"/chemkin \
337-
test/regression/"$regr_test"/chemkin 2> regression.py.err
338-
then
339-
echo "<summary>$regr_test Passed Observable Testing ✅</summary>"
340-
else
341-
echo "<summary>$regr_test Failed Observable Testing ❌</summary>"
342-
export FAILED=Yes
343-
fi
344-
echo "</details>"
345-
if [ -s regression.py.err ]; then
346-
echo "<details>"
347-
echo "<summary>Errors occurred during observable testing ⚠️</summary>"
348-
cat regression.py.err
349-
echo "</details>"
350-
fi
351-
fi
352-
echo ""
353-
done
354-
if [[ ${FAILED} ]]; then
355-
echo "⚠️ One or more regression tests failed." | tee -a $GITHUB_STEP_SUMMARY >&2
356-
echo "Please download the failed results and run the tests locally or check the log to see why." | tee -a $GITHUB_STEP_SUMMARY >&2
357-
fi
358-
359-
- name: Prepare Results for PR Comment
360-
if: ${{ env.REFERENCE_JOB == 'false' }}
361-
env:
362-
PR_NUMBER: ${{ github.event.number || github.event.after || github.event_name }}
363-
run: |
364-
echo $PR_NUMBER > summary.txt
365-
echo "## Regression Testing Results" >> summary.txt
366-
cat regression.stderr >> summary.txt
367-
echo "<details>" >> summary.txt
368-
echo "<summary>Detailed regression test results.</summary>" >> summary.txt
369-
cat regression.stdout >> summary.txt
370-
echo "</details>" >> summary.txt
371-
echo "" >> summary.txt
372-
echo "_beep boop this comment was written by a bot_ :robot:" >> summary.txt
373-
cat summary.txt > $GITHUB_STEP_SUMMARY
374-
375-
- name: Upload regression summary artifact
376-
# the annotate workflow uses this artifact to add a comment to the PR
377-
uses: actions/upload-artifact@v4
378-
if: ${{ github.event_name == 'pull_request' }}
379-
with:
380-
name: regression_summary
381-
path: summary.txt
382-
383-
- name: Upload Comparison Results
384-
uses: actions/upload-artifact@v4
385-
with:
386-
name: regression_test_comparison_results
387-
path: |
388-
test/regression-diff
389-
390-
# Install and Call codecov only if the tests were successful (permitting failures in the regression comparison tests)
391-
- name: Code coverage install and run
392-
if: success() || ( failure() && steps.regression-execution.conclusion == 'success' )
393-
run: |
394-
conda install -y -c conda-forge codecov
395-
codecov
396-
39755
build-and-push-docker:
39856
# after testing and on pushes to main, build and push docker image
39957
#
40058
# taken from https://github.com/docker/build-push-action
401-
needs: [build-and-test, regression-test]
40259
runs-on: ubuntu-latest
40360
# Run on push to main or on pull requests
40461
if: |

0 commit comments

Comments
 (0)