Skip to content

Commit 676f5c1

Browse files
authored
Merge branch 'fix/docs' into fix/docs-wiki2website
2 parents 532dcb4 + 90ef305 commit 676f5c1

File tree

16 files changed

+2311
-83
lines changed

16 files changed

+2311
-83
lines changed

.github/workflows/CI.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# 2023-07-17 - made it pass by default
2626
# 2023-07-21 - upload the regression results summary as artifact (for use as a comment on PRs)
2727
# 2023-07-31 - removed option to run from RMG-database with GitHub resuable workflows
28+
# 2024-10-01 - deprecated Mambaforge with Miniforge3 for environment creation
2829

2930
name: Continuous Integration
3031

@@ -61,14 +62,25 @@ jobs:
6162
- name: Checkout RMG-Py
6263
uses: actions/checkout@v4
6364

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+
6475
# configures the mamba environment manager and builds the environment
65-
- name: Setup Mambaforge Python 3.7
76+
- name: Setup Miniforge Python 3.7
6677
uses: conda-incubator/setup-miniconda@v3
6778
with:
6879
environment-file: environment.yml
69-
miniforge-variant: Mambaforge
80+
miniforge-variant: Miniforge3
7081
miniforge-version: latest
7182
python-version: 3.7
83+
condarc-file: condarc.yml
7284
activate-environment: rmg_env
7385
use-mamba: true
7486

@@ -111,14 +123,25 @@ jobs:
111123
- name: Checkout RMG-Py
112124
uses: actions/checkout@v4
113125

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+
114136
# configures the mamba environment manager and builds the environment
115-
- name: Setup Mambaforge Python 3.7
137+
- name: Setup Miniforge Python 3.7
116138
uses: conda-incubator/setup-miniconda@v3
117139
with:
118140
environment-file: environment.yml
119-
miniforge-variant: Mambaforge
141+
miniforge-variant: Miniforge3
120142
miniforge-version: latest
121143
python-version: 3.7
144+
condarc-file: condarc.yml
122145
activate-environment: rmg_env
123146
use-mamba: true
124147

@@ -167,7 +190,7 @@ jobs:
167190
id: regression-execution
168191
timeout-minutes: 60
169192
run: |
170-
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;
193+
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;
171194
do
172195
if python-jl rmg.py test/regression/"$regr_test"/input.py; then
173196
echo "$regr_test" "Executed Successfully"
@@ -218,16 +241,16 @@ jobs:
218241
- name : Find ID of Reference Results
219242
env:
220243
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
244+
# this will search for the last successful execution of CI on main
221245
run: |
222-
run_id=$(gh run list -R ReactionMechanismGenerator/RMG-Py --workflow="Continuous Integration" --branch main --limit 1 --json databaseId --jq '.[0].databaseId')
246+
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')
223247
echo "CI_RUN_ID=$run_id" >> $GITHUB_ENV
224248
225249
- name: Retrieve Stable Regression Results
226250
if: ${{ env.REFERENCE_JOB == 'false' }}
227251
uses: actions/download-artifact@v4
228252
with:
229-
# this will search for the last successful execution of CI on main and download
230-
# the stable regression results
253+
# download stable regression results
231254
run-id: ${{ env.CI_RUN_ID }}
232255
repository: ReactionMechanismGenerator/RMG-Py
233256
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -243,7 +266,7 @@ jobs:
243266
run: |
244267
exec 2> >(tee -a regression.stderr >&2) 1> >(tee -a regression.stdout)
245268
mkdir -p "test/regression-diff"
246-
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment;
269+
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
247270
do
248271
echo ""
249272
echo "### Regression test $regr_test:"
@@ -378,7 +401,7 @@ jobs:
378401
password: ${{ secrets.DOCKERHUB_TOKEN }}
379402

380403
- name: Build and Push
381-
uses: docker/build-push-action@v4
404+
uses: docker/build-push-action@v6
382405
with:
383406
push: true
384407
tags: reactionmechanismgenerator/rmg:latest

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
fetch-depth: 0
2828

2929
- name: Setup Mambaforge Python 3.7
30-
uses: conda-incubator/setup-miniconda@v2
30+
uses: conda-incubator/setup-miniconda@v3
3131
with:
3232
environment-file: environment.yml
33-
miniforge-variant: Mambaforge
33+
miniforge-variant: Miniforge3
3434
miniforge-version: latest
3535
python-version: 3.7
3636
activate-environment: rmg_env

Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ RUN apt-get update && \
2323
apt-get clean -y
2424

2525
# Install conda
26-
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
27-
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda && \
28-
rm Miniconda3-latest-Linux-x86_64.sh
29-
ENV PATH="$PATH:/miniconda/bin"
26+
RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" && \
27+
bash Miniforge3-Linux-x86_64.sh -b -p /miniforge && \
28+
rm Miniforge3-Linux-x86_64.sh
29+
ENV PATH="$PATH:/miniforge/bin"
3030

3131
# Set solver backend to mamba for speed
3232
RUN conda install -n base conda-libmamba-solver && \
@@ -35,12 +35,18 @@ RUN conda install -n base conda-libmamba-solver && \
3535
# Set Bash as the default shell for following commands
3636
SHELL ["/bin/bash", "-c"]
3737

38+
# Add build arguments for RMG-Py, RMG-database, and RMS branches.
39+
ARG RMG_Py_Branch=main
40+
ARG RMG_Database_Branch=main
41+
ARG RMS_Branch=main
42+
ENV rmsbranch=${RMS_Branch}
43+
3844
# cd
3945
WORKDIR /rmg
4046

4147
# Clone the RMG base and database repositories
42-
RUN git clone --single-branch --branch main --depth 1 https://github.com/ReactionMechanismGenerator/RMG-Py.git && \
43-
git clone --single-branch --branch main --depth 1 https://github.com/ReactionMechanismGenerator/RMG-database.git
48+
RUN git clone --single-branch --branch ${RMG_Py_Branch} --depth 1 https://github.com/ReactionMechanismGenerator/RMG-Py.git && \
49+
git clone --single-branch --branch ${RMG_Database_Branch} --depth 1 https://github.com/ReactionMechanismGenerator/RMG-database.git
4450

4551
WORKDIR /rmg/RMG-Py
4652
# build the conda environment
@@ -64,7 +70,7 @@ ENV PATH="$RUNNER_CWD/RMG-Py:$PATH"
6470
# setting this env variable fixes an issue with Julia precompilation on Windows
6571
ENV JULIA_CPU_TARGET="x86-64,haswell,skylake,broadwell,znver1,znver2,znver3,cascadelake,icelake-client,cooperlake,generic"
6672
RUN make && \
67-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' && \
73+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev=ENV["rmsbranch"])); using ReactionMechanismSimulator' && \
6874
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
6975

7076
# RMG-Py should now be installed and ready - trigger precompilation and test run

0 commit comments

Comments
 (0)