15
15
steps :
16
16
- uses : actions/checkout@v4
17
17
18
- - name : Change ownership of /github/home
19
- run : sudo chown -R $(whoami) /github/home
20
-
21
18
- name : Install system dependencies
22
19
if : runner.os == 'Linux'
23
20
run : |
32
29
&& sudo apt install gh -y
33
30
shell : /bin/bash {0}
34
31
35
- #
36
- # - name: Setup Python and virtual environment using requirements file
37
- # id: setup-python-venv
38
- # uses: srvanderplas/[email protected]
39
- # with:
40
- # python-version-file: '.python-version'
41
- # cache-dependency-path: requirements.txt
42
- # install-cmd: "./py-deps -i"
43
-
44
- # - name: Test
45
- # run: |
46
- # echo $RETICULATE_PYTHON;
47
- # echo $RETICULATE_PYTHON_ENV;
48
- # echo "$pythonLocation" >> $GITHUB_PATH;
49
- #
50
-
51
32
- name : Renv setup
52
33
uses : r-lib/actions/setup-renv@v2
53
34
@@ -67,15 +48,18 @@ jobs:
67
48
reticulate::virtualenv_create("venv", requirements="requirements.txt")
68
49
reticulate::use_virtualenv("venv")
69
50
reticulate::py_config()
51
+ # Set reticulate_python env var
70
52
writeLines(
71
53
paste0("RETICULATE_PYTHON=", reticulate::virtualenv_python("venv")),
72
54
Sys.getenv("GITHUB_ENV"))
55
+ # Paste string to describe cache
73
56
writeLines(
74
57
paste0("PY_CACHE_STR=python",
75
58
paste(
76
59
readLines(".python-version"),
77
60
reticulate::virtualenv_python("venv"),
78
- digest::digest(readLines("requirements.txt"))
61
+ digest::digest(readLines("requirements.txt")),
62
+ sep = "-"
79
63
)),
80
64
Sys.getenv("GITHUB_ENV"))
81
65
89
73
id : cache-venv
90
74
with :
91
75
path : .virtualenvs/r-reticulate
92
- key : setup-venv-${{ runner.os }}-${{ env.PY_CACHE_STR }}
76
+ key : setup-venv-${{ env.PY_CACHE_STR }}
93
77
94
78
- uses : quarto-dev/quarto-actions/setup@v2
95
79
with :
0 commit comments