Skip to content

Commit 97fea31

Browse files
Update R-CMD-check.yaml
1 parent 38553f2 commit 97fea31

File tree

1 file changed

+60
-32
lines changed

1 file changed

+60
-32
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,88 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
1+
name: R-CMD-check
2+
33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76
pull_request:
8-
branches:
9-
- main
10-
11-
name: R-CMD-check
7+
branches: [main]
128

139
jobs:
1410
R-CMD-check:
1511
runs-on: ubuntu-latest
12+
1613
steps:
17-
- uses: actions/checkout@v2
18-
- uses: r-lib/actions/setup-r@v2-branch
14+
- uses: actions/checkout@v4
15+
16+
- uses: r-lib/actions/setup-r@v2
1917
with:
2018
Ncpus: 4
21-
- uses: r-lib/actions/setup-tinytex@v2-branch
22-
- uses: r-lib/actions/setup-pandoc@v2-branch
19+
- uses: r-lib/actions/setup-tinytex@v2
20+
- uses: r-lib/actions/setup-pandoc@v2
21+
22+
- name: Prepare month stamp for caches
23+
id: stamp
24+
run: echo "datem=$(date '+%Y-%m')" >> "$GITHUB_OUTPUT"
2325

24-
- name: "[Custom block] [Cache] Prepare weekly timestamp for cache"
25-
id: date
26-
run: echo "::set-output name=datem::$(date '+%Y-%m')"
27-
2826
- name: Cache R packages
2927
uses: pat-s/always-upload-cache@v2
3028
with:
3129
path: ${{ env.R_LIBS_USER }}
32-
key: rcache-${{steps.date.outputs.datem}}
33-
restore-keys: ${{steps.date.outputs.datem}}
30+
key: rcache-${{ steps.stamp.outputs.datem }}
31+
restore-keys: rcache-
3432

35-
- name: Cache python
33+
- name: Cache pip
3634
uses: pat-s/always-upload-cache@v2
3735
with:
3836
path: ~/.cache/pip
39-
key: pycache-${{steps.date.outputs.datem}}
40-
restore-keys: pycache-${{steps.date.outputs.datem}}
41-
42-
- name: Install linux prerequesites
37+
key: pycache-${{ steps.stamp.outputs.datem }}
38+
restore-keys: pycache-
39+
40+
- name: Install system libs (image + common)
4341
run: |
44-
sudo apt-get install libxml2-dev libcurl4-openssl-dev
45-
- name: Install dependencies - Keras & TF
42+
sudo apt-get update
43+
sudo apt-get install -y \
44+
libpng-dev libjpeg-turbo8-dev libtiff5-dev \
45+
libxml2-dev libcurl4-openssl-dev libssl-dev
46+
47+
- name: Install base R deps (reticulate, rcmdcheck)
48+
run: |
49+
install.packages(c("remotes","reticulate","rcmdcheck"))
50+
shell: Rscript {0}
51+
52+
- name: Create Miniconda env and install TF/Keras 2.10 stack
4653
run: |
47-
install.packages(c("remotes", "rcmdcheck"))
48-
remotes::install_deps(dependencies = TRUE)
4954
reticulate::install_miniconda(update = TRUE)
5055
reticulate::conda_create('r-reticulate', packages = c('python==3.8'))
51-
keras::install_keras(version = "2.10.0", tensorflow = "2.10.0", extra_packages = c('IPython', 'requests', 'certifi', 'urllib3', 'six', 'tensorflow_probability==0.16.0'))
52-
torch::install_torch()
56+
reticulate::conda_install('r-reticulate', pip = TRUE, packages = c(
57+
'numpy<2.0',
58+
'tensorflow==2.10.*',
59+
'keras==2.10.*',
60+
'tensorflow_probability==0.16.*'
61+
))
62+
cat(sprintf("RETICULATE_PYTHON=%s\n",
63+
file.path(reticulate::miniconda_path(), "envs","r-reticulate","bin","python")),
64+
file = Sys.getenv("GITHUB_ENV"), append = TRUE)
5365
shell: Rscript {0}
54-
- name: Install dependencies - Tutorial (Vignette)
66+
67+
- uses: r-lib/actions/setup-r-dependencies@v2
68+
with:
69+
sysreqs: true
70+
extra-packages: >
71+
any::png
72+
any::jpeg
73+
any::tiff
74+
any::tensorflow
75+
any::keras
76+
any::tfprobability
77+
needs: check
78+
79+
- name: Install vignette extras
5580
run: |
56-
install.packages(c("ggplot2", "reshape2", "MASS", "gamlss.data", "distr"))
81+
install.packages(c("ggplot2","reshape2","MASS","gamlss.data","distr"))
5782
shell: Rscript {0}
83+
5884
- name: Check
59-
run: rcmdcheck::rcmdcheck(args=c("--as-cran", "--no-build-vignettes"), build_args=c("--no-build-vignettes"), error_on="error")
85+
run: rcmdcheck::rcmdcheck(args = c("--as-cran","--no-build-vignettes"),
86+
build_args = c("--no-build-vignettes"),
87+
error_on = "error")
6088
shell: Rscript {0}

0 commit comments

Comments
 (0)