Update cache #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update cache | |
on: | |
schedule: | |
- cron: "0 0 */7 * *" | |
push: | |
branches: | |
- main | |
jobs: | |
update_cache: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Checkout T3 | |
uses: actions/checkout@v3 | |
- name: Cache RMG | |
id: cache-rmg | |
uses: actions/cache@v2 | |
with: | |
path: RMG-Py | |
key: ${{ runner.os }}-rmg-main | |
- name: Checkout RMG | |
uses: actions/checkout@v3 | |
with: | |
repository: ReactionMechanismGenerator/RMG-Py | |
path: RMG-Py | |
ref: main | |
fetch-depth: 1 | |
- name: Cache RMG-database | |
id: cache-rmg-db | |
uses: actions/cache@v2 | |
with: | |
path: RMG-database | |
key: ${{ runner.os }}-rmgdb-main | |
- name: Checkout RMG-database | |
uses: actions/checkout@v3 | |
with: | |
repository: ReactionMechanismGenerator/RMG-database | |
path: RMG-database | |
ref: main | |
fetch-depth: 1 | |
- name: Cache ARC | |
id: cache-arc | |
uses: actions/cache@v2 | |
with: | |
path: ARC | |
key: ${{ runner.os }}-arc-main | |
- name: Checkout ARC | |
uses: actions/checkout@v3 | |
with: | |
repository: ReactionMechanismGenerator/ARC | |
path: ARC | |
ref: main | |
fetch-depth: 1 | |
- name: Setup RMG-Py Env | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
activate-environment: rmg_env | |
use-mamba: true | |
- name: Cache RMG-Py env | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.CONDA }}/envs/rmg_env | |
key: | |
conda-${{ runner.os }}--${{ runner.arch }}-rmgpyenv-${{ env.CACHE_NUMBER}} | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
id: cache | |
- name: Update environment | |
run: mamba env update -n rmg_env -f RMG-Py/environment.yml | |
- name: Cythonize RMG-Py | |
run: | | |
cd RMG-Py | |
conda activate rmg_env | |
make | |
echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV | |
echo "PATH=$(pwd):$PATH" >> $GITHUB_ENV | |
echo "export rmgpy_path=$(pwd)" >> $GITHUB_ENV | |
echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> ~/.bashrc | |
echo "PATH=$(pwd):$PATH" >> ~/.bashrc | |
echo "export rmgpy_path=$(pwd)" >> ~/.bashrc | |
- name: Install PyCall RMG_ENV | |
run: python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()" | |
- name: Cache RMS | |
id: cache-rms | |
uses: actions/cache@v2 | |
env: | |
CACHE_NUMBER: 0 | |
with: | |
path: | | |
/usr/share/miniconda3/envs/rmg_env/share/julia/artifacts/ | |
/usr/share/miniconda3/envs/rmg_env/share/julia/packages/ | |
/usr/share/miniconda3/envs/rmg_env/share/julia/registries/ | |
/usr/share/miniconda3/envs/rmg_env/share/julia/compiled/ | |
key: | |
${{ runner.os }}-julia-${{ env.CACHE_NUMBER }}-rms | |
- name: Install RMS Julia | |
run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main"));using ReactionMechanismSimulator' | |
- name: Link Python-JL | |
run: | | |
ln -sfn $(which python-jl) $(which python) | |
cd .. | |
- name: Install ARC | |
run: | | |
cd ARC | |
mamba env create -f environment.yml | |
conda activate arc_env | |
echo "export arc_path=$(pwd)" >> $GITHUB_ENV | |
echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV | |
echo "PATH=$(pwd):$PATH" >> $GITHUB_ENV | |
echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> ~/.bashrc | |
echo "PATH=$(pwd):$PATH" >> ~/.bashrc | |
echo "export arc_path=$(pwd)" >> ~/.bashrc | |
cd .. | |
- name: Install xtb | |
run: | | |
mamba create -n xtb_env python=3.7 -c conda-forge -y | |
conda activate xtb_env | |
mamba install -c conda-forge xtb -y | |
mamba install -c anaconda pyyaml -y | |
- name: Cache Conda Packages | |
uses: actions/cache@v2 | |
env: | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}-t3 | |
- name: Install T3 | |
run: | | |
mamba env create -f environment.yml |