Skip to content

Commit 1b58359

Browse files
committed
fix windows node_modules errors
1 parent 08e16db commit 1b58359

File tree

10 files changed

+88
-72
lines changed

10 files changed

+88
-72
lines changed

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ rworkflows-merged
1919
^Meta$
2020
^codecov\.yml$
2121
^_pkgdown\.yml$
22+
^node_modules$
23+
^package-lock\.json$
24+
^package\.json$
25+
2226
^docs$
2327
^pkgdown$
2428
^Dockerfile$

.github/workflows/rworkflows_static.yml

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ env:
2121
run_covr: ${{ true }}
2222
run_pkgdown: ${{ false }}
2323
has_runit: ${{ false }}
24-
has_latex: ${{ true }}
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
has_latex: ${{ false }}
2625
run_docker: ${{ false }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
2828
cache_version: cache-v1
29+
enable_act: ${{ false }}
2930
jobs:
3031
rworkflows_static:
3132
permissions:
@@ -59,7 +60,7 @@ jobs:
5960
GITHUB_REPO: ${{ github.repository }}
6061
RGL_USE_NULL: ${{ true }}
6162
steps:
62-
- name: Set GitHub environment variables
63+
- name: "Set GitHub environment variables \U0001F3DE"
6364
run: |
6465
echo "GITHUB_TOKEN=${{ env.GITHUB_TOKEN }}" >> $GITHUB_ENV
6566
echo "RGL_USE_NULL=TRUE" >> $GITHUB_ENV
@@ -68,31 +69,31 @@ jobs:
6869
echo "TZ=UTC" >> $GITHUB_ENV
6970
echo "NOT_CRAN=${{ !env.as_cran }}" >> $GITHUB_ENV
7071
shell: bash {0}
71-
- name: Set R library home on Linux
72+
- name: "Set R library home on Linux \U0001F4DA"
7273
if: runner.os == 'Linux'
7374
run: |
7475
mkdir -p /__w/_temp/Library
7576
echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile
7677
git config --global --add safe.directory '*'
7778
shell: bash {0}
78-
- name: Checkout repository
79-
uses: actions/checkout@v3
80-
- name: Setup R and Bioconductor
79+
- name: Checkout repository
80+
uses: actions/checkout@v4
81+
- name: "Setup R and Bioconductor \U0001F6E0"
8182
if: runner.os != 'Linux'
8283
uses: grimbough/bioc-actions/setup-bioc@v1
8384
with:
8485
bioc-version: ${{ matrix.config.bioc }}
85-
- name: Setup pandoc from r-lib
86+
- name: "Setup pandoc from r-lib \U0001F6E0"
8687
if: runner.os != 'Linux'
8788
uses: r-lib/actions/setup-pandoc@v2
88-
- name: Query dependencies
89+
- name: Query dependencies
8990
run: |
9091
options(crayon.enabled = TRUE)
9192
install.packages('remotes')
9293
remotes::install_github("r-lib/remotes")
9394
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
9495
shell: Rscript {0}
95-
- name: Restore R package cache
96+
- name: "Restore R package cache \U0001F3E6"
9697
if: |
9798
!contains(github.event.head_commit.message, '/nocache') && runner.os != 'Linux'
9899
uses: actions/cache@v3
@@ -102,7 +103,7 @@ jobs:
102103
}}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
103104
restore-keys: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc
104105
}}-r-${{ matrix.config.r }}-
105-
- name: Cache R packages on Linux
106+
- name: "Cache R packages on Linux \U0001F3E6"
106107
if: |
107108
!contains(github.event.head_commit.message, '/nocache') && runner.os == 'Linux'
108109
uses: actions/cache@v3
@@ -112,15 +113,15 @@ jobs:
112113
}}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
113114
restore-keys: ${{ env.cache_version }}-${{ runner.os }}-biocversion-${{ matrix.config.bioc
114115
}}-r-${{ matrix.config.r }}-
115-
- name: Install Linux system dependencies
116+
- name: "Install Linux system dependencies \U0001F6E0"
116117
if: runner.os == 'Linux'
117118
run: |
118119
sysreqs=$(Rscript -e 'cat("apt-get update -y && apt-get install -y", paste(gsub("apt-get install -y ", "", remotes::system_requirements("ubuntu", "20.04")), collapse = " "))')
119120
echo $sysreqs
120121
sudo -s eval "$sysreqs"
121122
sudo apt-get install -y qpdf rsync
122123
shell: bash {0}
123-
- name: Install macOS system dependencies
124+
- name: "Install macOS system dependencies \U0001F6E0"
124125
if: runner.os == 'macOS'
125126
run: |
126127
#### --- Justifications for each package --- ####
@@ -148,30 +149,32 @@ jobs:
148149
### Set up xml2 ###
149150
echo "XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config" >> $GITHUB_ENV
150151
shell: bash {0}
151-
- name: Install Windows system dependencies
152+
- name: "Install Windows system dependencies \U0001F6E0"
152153
if: env.has_latex == 'true' && runner.os == 'Windows'
153154
run: |
154155
#### npm ####
155156
npm install curl
156157
shell: pwsh {0}
157-
- name: Install latex
158+
- name: "Install latex \U0001F6E0"
158159
if: env.has_latex == 'true'
159160
uses: r-lib/actions/setup-tinytex@v2
160161
env:
161-
TINYTEX_INSTALLER: TinyTeX
162-
- name: Install additional LaTeX packages (non-Windows)
163-
if: env.has_latex == 'true' && runner.os != 'Windows'
164-
run: |
165-
tlmgr install bera nowidow parnotes marginfix etoolbox titlesec sectsty framed enumitem parskip soul placeins footmisc changepage xstring caption mathtools
166-
tlmgr list --only-installed
167-
shell: bash {0}
168-
- name: Install additional LaTeX packages (Windows)
169-
if: env.has_latex == 'true' && runner.os == 'Windows'
162+
TINYTEX_INSTALLER: ${{ env.tinytex_installer }}
163+
TINYTEX_VERSION: ${{ env.tinytex_version }}
164+
- name: "Install latex \U0001F6E0"
165+
if: env.has_latex == 'true'
166+
env:
167+
tinytex_installer: ${{ env.tinytex_installer }}
168+
tinytex_version: ${{ env.tinytex_version }}
170169
run: |
171-
tlmgr install bera nowidow parnotes marginfix etoolbox titlesec sectsty framed enumitem parskip soul placeins footmisc changepage xstring caption mathtools
172-
tlmgr list --only-installed
173-
shell: pwsh
174-
- name: Install dependencies pass 1
170+
install.packages("tinytex")
171+
extra_packages <- c("bera","nowidow","parnotes","marginfix","etoolbox",
172+
"titlesec","sectsty","framed","enumitem","parskip","soul","placeins",
173+
"footmisc","changepage","xstring","caption","mathtools","fancyhdr",
174+
"preprint","ragged2e","pdfcrop","titling","silence","everysel")
175+
tinytex::tlmgr_install(pkgs = extra_packages)
176+
shell: Rscript {0}
177+
- name: "Install dependencies pass 1 \U0001F6E0"
175178
env:
176179
timeout: ${{ env.timeout }}
177180
run: |
@@ -184,7 +187,7 @@ jobs:
184187
remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE)
185188
continue-on-error: ${{ true }}
186189
shell: Rscript {0}
187-
- name: Install dependencies pass 2
190+
- name: "Install dependencies pass 2 \U0001F6E0"
188191
env:
189192
timeout: ${{ env.timeout }}
190193
run: |
@@ -193,25 +196,25 @@ jobs:
193196
repos <- BiocManager::repositories()
194197
remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE)
195198
shell: Rscript {0}
196-
- name: Install RUnit (via BiocGenerics)
199+
- name: "Install RUnit (via BiocGenerics) \U0001F6E0"
197200
if: env.has_runit == 'true'
198201
run: |
199202
options(crayon.enabled = TRUE)
200203
BiocManager::install("BiocGenerics")
201204
shell: Rscript {0}
202-
- name: Install covr
205+
- name: "Install covr \U0001F6E0"
203206
if: env.run_covr == 'true' && runner.os == 'Linux'
204207
run: |
205208
options(crayon.enabled = TRUE)
206209
install.packages("covr")
207210
shell: Rscript {0}
208-
- name: Install pkgdown
211+
- name: "Install pkgdown \U0001F6E0"
209212
if: env.run_pkgdown == 'true' && runner.os == 'Linux'
210213
run: |
211214
options(crayon.enabled = TRUE)
212215
install.packages("pkgdown")
213216
shell: Rscript {0}
214-
- name: Session info
217+
- name: Session info ℹ️
215218
run: |
216219
options(width = 100, crayon.enabled = TRUE)
217220
pkgs <- installed.packages()[,"Package"]
@@ -220,7 +223,7 @@ jobs:
220223
sessioninfo::session_info(pkgs, include_base = TRUE)
221224
}, error = function(x){utils::sessionInfo()})
222225
shell: Rscript {0}
223-
- name: Run CMD check
226+
- name: Run CMD check
224227
if: env.run_rcmdcheck == 'true'
225228
env:
226229
_R_CHECK_CRAN_INCOMING_: ${{ false }}
@@ -233,27 +236,28 @@ jobs:
233236
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
234237
if(!require("rcmdcheck", quietly=TRUE)) install.packages("rcmdcheck")
235238
as_cran <- if(Sys.getenv("AS_CRAN")=='true') "--as-cran" else NULL
239+
run_build_vignettes <- if(Sys.getenv("run_vignettes")=='true') NULL else "--no-build-vignettes"
236240
run_vignettes <- if(Sys.getenv("run_vignettes")=='true') NULL else "--ignore-vignettes"
237241
rcmdcheck::rcmdcheck(
238242
args = c("--no-manual", "--timings", as_cran, run_vignettes),
239-
build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data"),
243+
build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data", run_build_vignettes),
240244
error_on = "warning",
241245
check_dir = "check")
242246
shell: Rscript {0}
243-
- name: Reveal testthat details
247+
- name: "Reveal testthat details \U0001F4CB"
244248
if: env.has_testthat == 'true'
245249
run: |
246250
find . -name testthat.Rout -exec cat '{}' ';'
247251
shell: bash {0}
248-
- name: Run RUnit tests (via BiocGenerics)
252+
- name: "Run RUnit tests (via BiocGenerics) \U0001F4CB"
249253
if: env.has_runit == 'true'
250254
env:
251255
timeout: ${{ env.timeout }}
252256
run: |
253257
options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout"))
254258
BiocGenerics:::testPackage()
255259
shell: Rscript {0}
256-
- name: Run BiocCheck
260+
- name: Run BiocCheck
257261
if: env.run_bioccheck == 'true'
258262
env:
259263
DISPLAY: 99.0
@@ -278,16 +282,16 @@ jobs:
278282
`no-check-CRAN` = as_cran,
279283
`no-check-bioc-help` = as_cran)
280284
shell: Rscript {0}
281-
- name: Test coverage
285+
- name: "Test coverage \U0001F4CB"
282286
if: env.run_covr == 'true' && runner.os == 'Linux'
283287
run: |
284288
covr::codecov()
285289
shell: Rscript {0}
286-
- name: Install package
290+
- name: "Install package \U0001F6E0"
287291
if: env.run_pkgdown == 'true' && runner.os == 'Linux'
288292
run: R CMD INSTALL .
289293
shell: bash {0}
290-
- name: Get R package info
294+
- name: Get R package info ℹ️
291295
if: runner.os == 'Linux'
292296
run: |
293297
#### DockerHub repos must be lowercase (,,) ####
@@ -299,7 +303,7 @@ jobs:
299303
echo "packageVersion=${version}" >> $GITHUB_ENV
300304
echo $version
301305
shell: bash {0}
302-
- name: Render README
306+
- name: "Render README \U0001F4E6"
303307
if: env.run_pkgdown == 'true' && runner.os == 'Linux'
304308
env:
305309
DISPLAY: 99.0
@@ -310,35 +314,36 @@ jobs:
310314
rmarkdown::render("README.Rmd", output_format = rmarkdown::github_document(html_preview = FALSE));
311315
}
312316
shell: Rscript {0}
313-
- name: Build pkgdown site
317+
- name: "Build pkgdown site \U0001F4E6"
314318
if: env.run_pkgdown == 'true' && runner.os == 'Linux'
315319
run: |
320+
options(crayon.enabled = TRUE)
316321
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
317322
shell: Rscript {0}
318-
- name: "Deploy pkgdown site to GitHub pages \U0001F680"
323+
- name: "Deploy pkgdown site to GitHub pages \U0001F4E6 \U0001F680"
319324
if: env.run_pkgdown == 'true' && runner.os == 'Linux'
320325
uses: JamesIves/github-pages-deploy-action@releases/v4
321326
with:
322327
clean: ${{ false }}
323328
branch: gh-pages
324329
folder: docs
325330
token: ${{ env.GITHUB_TOKEN }}
326-
- name: Upload check results
331+
- name: Upload check results
327332
if: failure()
328333
uses: actions/upload-artifact@v3
329334
with:
330335
name: ${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r
331336
}}-results
332337
path: check
333-
- name: Create Docker file
338+
- name: "Create Docker file \U0001F433"
334339
if: |
335340
(!contains(github.event.head_commit.message, '/nodocker')) && env.run_docker == 'true' && runner.os == 'Linux'
336341
run: |
337342
options(crayon.enabled = TRUE)
338343
if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows")
339344
path <- rworkflows::use_dockerfile()
340345
shell: Rscript {0}
341-
- name: Build and push to DockerHub
346+
- name: "Build and push to DockerHub \U0001F433 \U0001F680"
342347
if: |
343348
(!contains(github.event.head_commit.message, '/nodocker')) && env.run_docker == 'true' && runner.os == 'Linux'
344349
uses: docker/build-push-action@v1

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* `fill_yaml`
3232
- Simplify code.
3333
- Add subfunction `omit_if_default` to omit tinytex args from yaml.
34+
* `is_rstudio`: new interal helper function.
3435

3536
## Bug fixes
3637

@@ -40,6 +41,10 @@
4041
* CRAN checks:
4142
- Downgrade `BiocPkgTools`/`biocViews` to Suggests to
4243
compensate for issues with the CRAN server: #65
44+
* `fill_yaml`:
45+
- When `template="rworkflows_static"`, prevent `with2` from simplifying to vector.
46+
* `construct_runners`
47+
- `rspm` wasn't getting added.
4348

4449
# rworkflows 0.99.12
4550

R/construct_runners.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ construct_runners <- function(os=c("ubuntu-latest",
3838
cont = construct_cont(
3939
default_tag = bioc[[1]],
4040
run_check_cont = run_check_cont),
41-
rspm = list(paste0(
41+
rspm = list(
42+
paste0(
4243
"https://packagemanager.rstudio.com/",
43-
"cran/__linux__/latest/release"
44-
),
45-
NULL,
46-
NULL),
44+
"cran/__linux__/latest/release"),
45+
NULL,
46+
NULL),
4747
verbose = TRUE
4848
){
4949
# devoptera::args2vars(construct_runners, reassign = TRUE)
@@ -52,7 +52,8 @@ construct_runners <- function(os=c("ubuntu-latest",
5252
args <- construct_runners_check_args(os = os,
5353
bioc = bioc,
5454
r = r,
55-
cont = cont)
55+
cont = cont,
56+
rspm = rspm)
5657
#### Set runners ####
5758
runners <- lapply(os, function(o){
5859
if(isTRUE(versions_explicit)){

R/construct_runners_check_args.R

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ construct_runners_check_args <- function(os,
22
bioc,
33
r,
44
cont,
5+
rspm,
56
versions_explicit=FALSE,
67
verbose=TRUE){
78

89

910
#### Fill names ####
10-
args <- list(os=os, bioc=bioc, r=r, cont=cont)
11+
args <- list(os=os, bioc=bioc, r=r, cont=cont, rspm=rspm)
1112
args2 <- lapply(stats::setNames(names(args),
1213
names(args)),
1314
function(nm){
@@ -34,21 +35,12 @@ construct_runners_check_args <- function(os,
3435
}
3536
)
3637
#### Check names ####
37-
if(!all(os %in% names(args2$bioc))){
38-
stp <- paste(
39-
"All `os` must be names of elements in `bioc_version` argument.")
40-
stop(stp)
41-
}
42-
if(!all(os %in% names(args2$r))){
43-
stp <- paste(
44-
"All `os` must be names of elements in `r` argument.")
45-
stop(stp)
46-
}
47-
if(!all(os %in% names(args2$cont))){
48-
stp <- paste(
49-
"All `os` must be names of elements in `cont` argument.")
50-
stop(stp)
51-
}
38+
for(nm in names(args2)[-1]){
39+
if(!all(os %in% names(args2[[nm]]))){
40+
stopper("All `os` must be names of elements in",
41+
paste0("`",nm,"`"),"argument.")
42+
}
43+
}
5244
#### Return ####
5345
return(args2)
5446
}

R/fill_yaml.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fill_yaml <- function(yml,
3939
}
4040
#### static workflow vs. action ####
4141
if(template=="rworkflows_static"){
42-
with2 <- yml$env
42+
with2 <- as.list(yml$env)
4343
} else if(template=="rworkflows"){
4444
#### Set tag ####
4545
yml$jobs[[1]]$steps[[2]]$uses <- paste0("neurogenomics/",template,tag)

0 commit comments

Comments
 (0)