Skip to content

Commit 9bff0d9

Browse files
author
Susan Vanderplas
committed
update workflow
1 parent 33041ec commit 9bff0d9

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

.github/workflows/main.yml

+39-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1212
GH_PAT: ${{ secrets.GH_PAT }}
1313
GITHUB_PAT: ${{ secrets.GH_PAT }}
14+
PYENV_PATHS_ROOT: '~/.pyenv'
15+
PYENV_PATHS_VENV: '~/.virtualenvs/venv'
16+
PYENV_PATHS_RETICULATE: '~/.local/share/r-reticulate'
1417

1518
steps:
1619
- uses: actions/checkout@v4
@@ -38,7 +41,36 @@ jobs:
3841
renv::status()
3942
renv::diagnostics()
4043
44+
- name: Restore reticulate cache
45+
id: restore-reticulate-cache
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
${{ env.PYENV_PATHS_RETICULATE }}
50+
key: local-share-reticulate-${{ env.PY_CACHE_STR }}
51+
restore-keys: local-share-reticulate-
52+
53+
- name: Restore venv cache
54+
id: restore-venv-cache
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
${{ env.PYENV_PATHS_VENV }}
59+
key: pyenv-${{ env.PY_CACHE_STR }}
60+
restore-keys: pyenv-
61+
62+
- name: Restore pyenv cache
63+
id: restore-pyenv-cache
64+
uses: actions/cache@v4
65+
with:
66+
path: |
67+
${{ env.PYENV_PATHS_ROOT }}
68+
key: reticulate-venv-${{ env.PY_CACHE_STR }}
69+
restore-keys: reticulate-venv-
70+
71+
4172
- name: Setup Python/venv with reqs file in reticulate
73+
if: ${{ steps.restore-pyenv-cache.outputs.cache-hit != 'true' && steps.restore-venv-cache.outputs.cache-hit != 'true' && steps.restore-reticulate-cache.outputs.cache-hit != 'true' }}
4274
id: setup-reticulate-venv
4375
shell: Rscript {0}
4476
run: |
@@ -69,21 +101,22 @@ jobs:
69101
devtools::session_info()
70102
reticulate::py_config()
71103
104+
- uses: actions/cache@v4 # v4.0.0
105+
id: cache-venv-deps2
106+
with:
107+
path: ~/.pyenv
108+
key: pyenv-${{ env.PY_CACHE_STR }}
72109
- uses: actions/cache@v4 # v4.0.0
73110
id: cache-venv
74111
with:
75-
path: ~/.virtualenvs/r-reticulate
112+
path: ~/.virtualenvs/venv
76113
key: reticulate-venv-${{ env.PY_CACHE_STR }}
77114
- uses: actions/cache@v4 # v4.0.0
78115
id: cache-venv-deps1
79116
with:
80117
path: ~/.local/share/r-reticulate
81118
key: local-share-reticulate-${{ env.PY_CACHE_STR }}
82-
- uses: actions/cache@v4 # v4.0.0
83-
id: cache-venv-deps2
84-
with:
85-
path: ~/.pyenv
86-
key: pyenv-${{ env.PY_CACHE_STR }}
119+
87120

88121
- uses: quarto-dev/quarto-actions/setup@v2
89122
with:

0 commit comments

Comments
 (0)