Skip to content

Commit

Permalink
Test parse file
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Sep 8, 2023
1 parent 8543903 commit 0e29972
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/rstanarm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
# Github Actions workflow to check and build StanHeaders and RStan
# yamllint disable rule:line-length

name: test-jm

'on':
push:
branches:
- test-rstanarm

jobs:
R-CMD-check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: true
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'oldrel'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel'}
- {os: ubuntu-20.04, r: 'devel'}
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'oldrel'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
options(install.packages.check.source = "no")
options(pkgType = ifelse(grepl("linux", R.version$os), "source", "binary"))
install.packages('remotes')
install.packages('V8')
saveRDS(remotes::dev_package_deps(pkg = "./rstan/rstan", dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('./rstan/rstan/DESCRIPTION'))")
sudo -s eval "$sysreqs"
shell: bash

- name: Install dependencies
run: |
remotes::install_deps(pkg = "./rstan/rstan")
remotes::install_cran("rcmdcheck")
remotes::install_cran("rstantools", type = "source")
remotes::install_cran("sessioninfo")
if (utils::packageVersion("sessioninfo") >= "1.2.1") {
sessioninfo::session_info(pkgs = "installed", include_base = TRUE)
} else {
options(width = 200)
sessioninfo::session_info(rownames(installed.packages()), include_base = TRUE)
}
shell: Rscript {0}

- name: Install StanHeaders and rstan
run: |
try(system("sh sh_b.sh --no-build-vignettes --no-manual"))
remotes::install_local("./rstan/rstan")
shell: Rscript {0}

- name: Test parse jm.txt
run: |
download.file("https://github.com/stan-dev/rstan/files/12554818/jm.txt","jm.txt")
rstan::stanc("jm.txt")
shell: Rscript {0}

0 comments on commit 0e29972

Please sign in to comment.