From 9c5db901fac71e7405ffa5c5b42d2b4d0f739855 Mon Sep 17 00:00:00 2001 From: michalovadek Date: Tue, 19 Nov 2024 15:17:25 +0000 Subject: [PATCH 1/6] set up gh actions --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 54 ++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 47ed739..fd18cfe 100755 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -29,3 +29,4 @@ this_data.rds \.png ^CRAN-RELEASE$ ^Meta$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..fde23ec --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,54 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples + +on: + push: + branches: [main, master, develop] + pull_request: + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - name: Install cmdstanr + run: | + Rscript -e 'install.packages("cmdstanr", repos = c("https://stan-dev.r-universe.dev", getOption("repos")))' + + - name: Install CmdStan + run: | + Rscript -e 'cmdstanr::install_cmdstan(cores = 1)' + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' From f7c28076b118139306f1312288d5c1c3bc471545 Mon Sep 17 00:00:00 2001 From: michalovadek Date: Tue, 19 Nov 2024 15:24:25 +0000 Subject: [PATCH 2/6] toolchain fix --- .github/workflows/R-CMD-check.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index fde23ec..825e0e2 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -38,7 +38,11 @@ jobs: - name: Install cmdstanr run: | Rscript -e 'install.packages("cmdstanr", repos = c("https://stan-dev.r-universe.dev", getOption("repos")))' - + + - name: Fix toolchain + run: | + Rscript -e 'cmdstanr::check_cmdstan_toolchain(fix = TRUE)' + - name: Install CmdStan run: | Rscript -e 'cmdstanr::install_cmdstan(cores = 1)' From be83356189f338ee556b92e8cbfe7d288e30f614 Mon Sep 17 00:00:00 2001 From: michalovadek Date: Tue, 19 Nov 2024 15:44:45 +0000 Subject: [PATCH 3/6] add to R profile --- .github/workflows/R-CMD-check.yaml | 8 +++++++- DESCRIPTION | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 825e0e2..aa5a027 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -28,6 +28,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes + steps: - uses: actions/checkout@v4 @@ -35,6 +36,11 @@ jobs: with: use-public-rspm: true + - name: Add cmdstanr repo + run: | + writeLines('options(repos = c(cmdstanr = "https://stan-dev.r-universe.dev", getOption(\"repos\")))', file("~/.Rprofile", "ab")) + shell: Rscript {0} + - name: Install cmdstanr run: | Rscript -e 'install.packages("cmdstanr", repos = c("https://stan-dev.r-universe.dev", getOption("repos")))' @@ -55,4 +61,4 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + build_args: 'c("--no-manual","--no-build-vignettes","--ignore-vignettes")' diff --git a/DESCRIPTION b/DESCRIPTION index 3bf1129..7ec966c 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,5 +43,6 @@ Encoding: UTF-8 LazyData: true NeedsCompilation: yes SystemRequirements: GNU make +Additional_repositories: https://stan-dev.r-universe.dev VignetteBuilder: R.rsp RoxygenNote: 7.3.2 From 62c6fbefcdc37ad049932bfec888dd8dc5595640 Mon Sep 17 00:00:00 2001 From: michalovadek Date: Tue, 19 Nov 2024 15:57:31 +0000 Subject: [PATCH 4/6] bump up minimum R version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7ec966c..6f7b991 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ Description: Offers item-response theory (IRT) ideal-point estimation for binary License: GPL Depends: methods, - R (>= 3.4.0) + R (>= 3.5.0) Imports: dplyr, svDialogs, From 41221f5276b6a51471994a25ea4f6c892fc847c3 Mon Sep 17 00:00:00 2001 From: michalovadek Date: Tue, 19 Nov 2024 16:06:56 +0000 Subject: [PATCH 5/6] cmdstanr to imports --- DESCRIPTION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6f7b991..c435392 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,11 +34,11 @@ Imports: ggthemes, posterior, R.rsp, - Rcpp + Rcpp, + cmdstanr Suggests: loo, - lubridate, - cmdstanr + lubridate Encoding: UTF-8 LazyData: true NeedsCompilation: yes From 257c8ade3b52ea3c5c0abe1dbc8d33cb2535f3e3 Mon Sep 17 00:00:00 2001 From: michalovadek Date: Tue, 19 Nov 2024 16:18:18 +0000 Subject: [PATCH 6/6] ignore vignette is not a thing --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index aa5a027..eddfeab 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -61,4 +61,4 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true - build_args: 'c("--no-manual","--no-build-vignettes","--ignore-vignettes")' + build_args: 'c("--no-manual","--no-build-vignettes")'