-
Notifications
You must be signed in to change notification settings - Fork 16
151 lines (125 loc) · 4.1 KB
/
cache-dependencies.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
151
# Preamble
name: Cache dependencies
on:
schedule:
- cron: '0 9 * * 1' # run every monday @ 9AM
# enable worflow to be run manually
workflow_dispatch:
env:
CACHE_NUMBER: 0
jobs:
cache-build-dependencies:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
MPI: no
OMP: no
PHDF5: no
DAGMC: no
EVENT: no
VECTFIT: no
LIBMESH: no
steps:
- uses: actions/checkout@v3
## TESTING CACHE ##
# Setup conda
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge # mamba is faster than base conda
miniforge-version: latest
activate-environment: saltproc-env
use-mamba: true
use-only-tar-bz2: true
- run: |
conda config --env --set pip_interop_enabled True
# check for existing cache
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v3
id: dependencies-cache
with:
path: |
/usr/share/miniconda3/envs/saltproc-env
~/openmc_src
~/endfb71_hdf5
~/.cache/pip
key: depcache-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
# Install dependencies
- name: Update environment
run: mamba env update -n saltproc-env -f environment.yml
if: steps.dependencies-cache.outputs.cache-hit != 'true'
- name: Install OpenMC cross section library
if: steps.dependencies-cache.outputs.cache-hit != 'true'
run: $GITHUB_WORKSPACE/scripts/ci/openmc-xs.bash
- name: OpenMC dependencies
run: |
sudo apt -y update
sudo apt install -y libhdf5-dev
- name: Download OpenMC
if: steps.dependencies-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: openmc-dev/openmc
path: openmc
submodules: recursive
- name: Build OpenMC from source if no cache if found
if: steps.dependencies-cache.outputs.cache-hit != 'true'
run: $GITHUB_WORKSPACE/tools/ci/build-openmc.sh
- name: Restore OpenMC source build from cache
if: steps.dependencies-cache.outputs.cache-hit == 'true'
run: $GITHUB_WORKSPACE/tools/ci/restore-openmc.sh
- name: Install SaltProc
run: pip install .
- name: Check packages
run: conda list
cache-doc-dependencies:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
## DOCUMENTATION CACHE ##
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge # mamba is faster than base conda
miniforge-version: latest
activate-environment: saltproc-doc-env
use-mamba: true
use-only-tar-bz2: true
- run: |
conda config --env --set pip_interop_enabled True
# check for existing cache
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v3
id: dependencies-cache
with:
path: |
/usr/share/miniconda3/envs/saltproc-doc-env
~/.cache/pip
key: depcache-${{ hashFiles('doc/doc-environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
# Install dependencies
- name: Update environment
run: mamba env update -n saltproc-doc-env -f doc/doc-environment.yml
if: steps.dependencies-cache.outputs.cache-hit != 'true'
- name: Download OpenMC
if: steps.dependencies-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: openmc-dev/openmc
path: openmc
- name: Build OpenMC API
if: steps.dependencies-cache.outputs.cache-hit != 'true'
run: |
cd openmc
pip install .
cd ../
- name: Install SaltProc
run: pip install .
- name: Check packages
run: conda list