-
Notifications
You must be signed in to change notification settings - Fork 5
150 lines (131 loc) · 4.67 KB
/
update-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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: Clean Ubuntu Image
uses: kfir4444/free-disk-space@main
with:
# This may remove tools actually needed - currently does not
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout T3
uses: actions/[email protected]
- name: Cache RMG
id: cache-rmg
uses: actions/[email protected]
with:
path: RMG-Py
key: ${{ runner.os }}-rmg-main
- name: Checkout RMG
uses: actions/[email protected]
with:
repository: ReactionMechanismGenerator/RMG-Py
path: RMG-Py
ref: main
fetch-depth: 1
- name: Cache RMG-database
id: cache-rmg-db
uses: actions/[email protected]
with:
path: RMG-database
key: ${{ runner.os }}-rmgdb-main
- name: Checkout RMG-database
uses: actions/[email protected]
with:
repository: ReactionMechanismGenerator/RMG-database
path: RMG-database
ref: main
fetch-depth: 1
- name: Cache ARC
id: cache-arc
uses: actions/[email protected]
with:
path: ARC
key: ${{ runner.os }}-arc-main
- name: Checkout ARC
uses: actions/[email protected]
with:
repository: ReactionMechanismGenerator/ARC
path: ARC
ref: main
fetch-depth: 1
- name: Setup RMG-Py Env
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: rmg_env
use-mamba: true
- name: Cache RMG-Py env
uses: actions/[email protected]
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 clean
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: Install RMS Julia
run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master"));Pkg.build("PyCall");Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator;'
- name: Install PyCall RMG_ENV
run: python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
- 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/[email protected]
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