Skip to content

Commit 49f0a6d

Browse files
add specific sysreqs for INLA installation (#139)
* add specific sysreqs for INLA installation * run on this dev branch * add udunits2 for fedora * check the package to verify if INLA is installed * we do not need to test the CRAN here * run checks on HEAD of the branch * no need to install from source * try without gsl install (old DESC file) * only update devtools - for speed * Revert "only update devtools - for speed" This reverts commit c05b5f9. * update only needed packages * go back to updating all * installing from source + checks * adding openssl as sysdep * adding curl as sysdep * trying INLA install via sysreq on Ubuntu * trying INLA install via sysreq Fedora * trying INLA install via sysreq Windows * running checks at the end * runnin on dev - to revert * upgrading ubuntu floavors * simpler dependency statemnt (incl. suggests) * also checks on macOS * adding the shlib_openmp_clfags to pkg_libs * addressing warning from checks * bump R6 to dependency so it is installed on cueck_built * include macos for testing * only fail on error * rely on rcmdcheck * removing prev. absent dep again * fix in build args param * adding sf as dependency (>fmesher>INLA) * ingore vignettes * losing Matrix req that requires R > 4.4.0 * remove dev running condition * install with pak (and thus sysdeps) * install curl for pak * separate step for pak install * including optional deps (i.e. also Suggests) * reverting dep for Matrix * adding INLA repo * cleaning up * try again with adding INLA repo * removing version pinning for Matrix * rely on sysdeps for fedora * ditch biocm specialy install * adding jags as sysdep (for ubuntu) * setup on Ubuntu with pak * removing dev running cond * now with pak * update might not be needed with pak * also adding libcurl for pak install * Case sensitivity * expicitely loading data * since tests run isolated - load package first * pak based setup on Fedora * adding Macos pak setup * better output for testthat * Windows setup with pak * updated instructions for Linux based systems * updated instructions for Linux based systems * formatting * adapting instructions for Mac&Windows * adaptig installing f GH * completing with pak install * adpted installation instructions for pak * cleaning up * keep only intallation steps * renaming * adapting setup batches * cleaning up * corrected naming * typo * completing from source install --------- Co-authored-by: Jonas I. Liechti <j-i-l@t4d.ch>
1 parent 4279bc3 commit 49f0a6d

8 files changed

Lines changed: 319 additions & 541 deletions

File tree

.github/workflows/onlabel_Fedora_setup.yml renamed to .github/workflows/Fedora_setup.yml

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ jobs:
4444
4545
- name: install config and build dependencies
4646
run: |
47-
dnf -y install pkg-config
48-
dnf -y install cmake
49-
dnf -y install R-devtools
47+
dnf -y install libcurl-devel # needed for pak
5048
51-
- name: install GSL
49+
- name: install pak
5250
run: |
53-
dnf -y install gsl-devel
51+
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
52+
shell: Rscript {0}
5453

5554
- name: install JAGS
5655
run: |
@@ -73,38 +72,16 @@ jobs:
7372
library("rjags")
7473
shell: Rscript {0}
7574

76-
- name: install INLA dependencies
77-
run: |
78-
dnf -y install udunits2-devel
79-
dnf -y install libcurl-devel # rCurls package (for INLA)
80-
dnf -y install openssl-devel # s2 package
81-
dnf -y install libjpeg-devel # jpeg package
82-
dnf -y install proj-devel # sf package
83-
dnf -y install geos-devel # sf package
84-
dnf -y install gdal-devel # terra package
85-
86-
- name: install INLA
87-
run: |
88-
install.packages("INLA", repos = c(CRAN = "https://cran.r-project.org", INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
89-
shell: Rscript {0}
90-
91-
- name: installing dependencies from BiocManager
92-
run: |
93-
if (!requireNamespace("BiocManager", quietly = TRUE))
94-
install.packages("BiocManager", repos=c(CRAN="https://cran.r-project.org"))
95-
BiocManager::install("Rgraphviz")
96-
BiocManager::install("graph")
97-
shell: Rscript {0}
98-
99-
- name: install from CRAN
100-
run: |
101-
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
102-
library('abn')
103-
shell: Rscript {0}
75+
# - name: install from CRAN with pak
76+
# run: |
77+
# pak::pkg_install('abn', dependencies=TRUE)
78+
# library('abn')
79+
# shell: Rscript {0}
10480

105-
- name: install from GitHub
81+
- name: pak install from GitHub
10682
run: |
107-
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
83+
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
84+
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
10885
library('abn')
10986
shell: Rscript {0}
11087

@@ -118,7 +95,5 @@ jobs:
11895

11996
- name: install from source
12097
run: |
121-
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
122-
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
123-
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
98+
pak::local_install(dependencies=TRUE)
12499
shell: Rscript {0}
Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
run: |
4040
brew install jags
4141
42-
- name: install rjags
43-
run: |
44-
install.packages("rjags", type="source", repos=c(CRAN="https://cran.r-project.org"))
45-
library("rjags")
46-
shell: Rscript {0}
42+
# - name: install rjags
43+
# run: |
44+
# install.packages("rjags", type="source", repos=c(CRAN="https://cran.r-project.org"))
45+
# library("rjags")
46+
# shell: Rscript {0}
4747

4848
- name: install INLA dependencies
4949
run: |
@@ -58,23 +58,21 @@ jobs:
5858
install.packages("INLA", repos = c(CRAN = "https://cran.r-project.org", INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
5959
shell: Rscript {0}
6060

61-
- name: installing dependencies from BiocManager
61+
- name: install pak
6262
run: |
63-
if (!requireNamespace("BiocManager", quietly = TRUE))
64-
install.packages("BiocManager", repos=c(CRAN="https://cran.r-project.org"))
65-
BiocManager::install("Rgraphviz")
66-
BiocManager::install("graph")
63+
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
6764
shell: Rscript {0}
6865

69-
- name: install from CRAN
70-
run: |
71-
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
72-
library('abn')
73-
shell: Rscript {0}
66+
# - name: install from CRAN with pak
67+
# run: |
68+
# pak::pkg_install('abn', dependencies=TRUE)
69+
# library('abn')
70+
# shell: Rscript {0}
7471

75-
- name: install from GitHub
72+
- name: pak install from GitHub
7673
run: |
77-
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
74+
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
75+
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
7876
library('abn')
7977
shell: Rscript {0}
8078

@@ -88,7 +86,5 @@ jobs:
8886

8987
- name: install from source
9088
run: |
91-
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
92-
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
93-
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
89+
pak::local_install(dependencies=TRUE)
9490
shell: Rscript {0}

.github/workflows/Ubuntu_setup.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Workflow is triggered on label and check installation on various operating systems
2+
# This action is adapted from https://github.com/t4d-gmbh/stubbed_versioning
3+
name: Ubuntu Install
4+
5+
on:
6+
push:
7+
branches:
8+
- "main"
9+
10+
env:
11+
BRANCH: ${{ github.head_ref || github.ref_name }}
12+
13+
permissions:
14+
packages: read
15+
contents: write
16+
pull-requests: write
17+
repository-projects: write
18+
19+
jobs:
20+
setup-and-install:
21+
runs-on: ubuntu-latest
22+
name: ubuntu-latest R release
23+
env:
24+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
25+
R_KEEP_PKG_SOURCE: yes
26+
27+
steps:
28+
29+
- name: Update and upgrade
30+
run: |
31+
sudo apt-get update && sudo apt-get upgrade
32+
33+
- name: install R
34+
run: |
35+
sudo apt-get -y install r-base
36+
37+
- name: fixing folder perms for local lib
38+
run: |
39+
sudo chown root:adm -R /usr/lib/R
40+
sudo chmod g+w -R /usr/lib/R
41+
sudo chown root:adm -R /usr/local/lib/R
42+
sudo chmod g+w -R /usr/local/lib/R
43+
44+
- name: install config and build dependencies
45+
run: |
46+
sudo apt-get -y install libcurl4-openssl-dev # needed for pak
47+
48+
- name: install pak
49+
run: |
50+
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
51+
shell: Rscript {0}
52+
53+
# - name: install from CRAN with pak
54+
# run: |
55+
# pak::pkg_install('abn', dependencies=TRUE)
56+
# library('abn')
57+
# shell: Rscript {0}
58+
59+
- name: pak install from GitHub
60+
run: |
61+
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
62+
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
63+
library('abn')
64+
shell: Rscript {0}
65+
66+
- name: fetch the repository from GitHub
67+
uses: actions/checkout@v4
68+
69+
- name: deactivate the renv
70+
run: |
71+
renv::deactivate()
72+
shell: Rscript {0}
73+
74+
- name: install from source
75+
run: |
76+
pak::local_install(dependencies=TRUE)
77+
shell: Rscript {0}

.github/workflows/onlabel_Windows_setup.yml renamed to .github/workflows/Windows_setup.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
R_KEEP_PKG_SOURCE: yes
3030
steps:
3131

32-
- name: prepare windows
32+
- name: install pak
3333
run: |
34-
install.packages("devtools", repos=c(CRAN="https://cran.r-project.org"))
34+
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
3535
shell: Rscript {0}
3636

3737
- name: install GSL
@@ -55,28 +55,16 @@ jobs:
5555
library("rjags")
5656
shell: Rscript {0}
5757

58-
- name: install INLA
59-
run: |
60-
install.packages("INLA", repos = c(CRAN = "https://cran.r-project.org", INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
61-
shell: Rscript {0}
62-
63-
- name: installing dependencies from BiocManager
64-
run: |
65-
if (!requireNamespace("BiocManager", quietly = TRUE))
66-
install.packages("BiocManager", repos=c(CRAN="https://cran.r-project.org"))
67-
BiocManager::install("Rgraphviz")
68-
BiocManager::install("graph")
69-
shell: Rscript {0}
70-
71-
- name: install from CRAN
72-
run: |
73-
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
74-
library('abn')
75-
shell: Rscript {0}
58+
# - name: install from CRAN with pak
59+
# run: |
60+
# pak::pkg_install('abn', dependencies=TRUE)
61+
# library('abn')
62+
# shell: Rscript {0}
7663

77-
- name: install from GitHub
64+
- name: pak install from GitHub
7865
run: |
79-
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
66+
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
67+
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
8068
library('abn')
8169
shell: Rscript {0}
8270

@@ -90,7 +78,12 @@ jobs:
9078

9179
- name: install from source
9280
run: |
93-
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
94-
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
95-
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
81+
pak::local_install(dependencies=TRUE)
82+
shell: Rscript {0}
83+
84+
- name: run the tests
85+
run: |
86+
pak::pak('r-lib/testthat')
87+
library("abn")
88+
testthat::test_local(path='tests', load_package='none')
9689
shell: Rscript {0}

.github/workflows/onlabel_Ubuntu_setup.yml

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)