Skip to content

Commit

Permalink
Merge pull request #1 from FBartos/BayesTools-rewrite
Browse files Browse the repository at this point in the history
updating to BayesTools & version 1.0.0
  • Loading branch information
FBartos committed May 27, 2022
2 parents c049667 + 80bf36a commit f11e22f
Show file tree
Hide file tree
Showing 226 changed files with 23,768 additions and 5,129 deletions.
23 changes: 17 additions & 6 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
^.*\.Rproj$
^RoBSA\.Rproj$
^\.Rproj\.user$
^trash$
^prefitted$
^tests/figs/.*$
^tests/results/.*$
^do-not-share$
^models$
^tests/results$
^tests/testthat/_snaps$
tests/testthat/test-1-load.R
tests/testthat/test-2-distributions.R
tests/testthat/test-3-setup.R
tests/testthat/test-4-fit.R
tests/testthat/test-5-methods.R
tests/testthat/test-6-plots.R
tests/testthat/test-7-diagnostics.R
tests/testthat/test-8-predict.R
tests/testthat/test-9-priors-calibration.R
^..Rcheck
^.*\.o
^docs$
^doc$
^Meta$
^RoBSA.Rcheck$
README.Rmd
README.Rmd
^\.github$
^codecov\.yml$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
124 changes: 124 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches:
- main
- master
- pre-release
pull_request:
branches:
- main
- master
- pre-release

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-devel, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: macOS-latest, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

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

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
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'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install JAGS (windows-latest)
if: runner.os == 'Windows'
run: |
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe
wjags.exe /S
del wjags.exe
shell: cmd

- name: Install JAGS (macOS-latest)
if: runner.os == 'macOS'
run : |
rm '/usr/local/bin/gfortran'
brew install automake jags
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
#remotes::install_version("BayesTools", "0.2.10")
remotes::install_github("FBartos/BayesTools@v0.2.10")
shell: Rscript {0}

- name: Check
if: runner.os != 'Windows'
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(
args = c("--no-manual", "--as-cran", "--ignore-vignettes"),
build_args = c("--no-build-vignettes"),
error_on = "warning",
check_dir = "check")
shell: Rscript {0}"

- name: Check
if: runner.os == 'Windows'
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
JAGS_ROOT: "/c/progra~1/JAGS/JAGS-4.2.0"
JAGS_MAJOR_VERSION: 4
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(
args = c("--no-manual", "--as-cran", "--ignore-vignettes"),
build_args = c("--no-build-vignettes"),
error_on = "warning",
check_dir = "check")
shell: Rscript {0}


- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
117 changes: 117 additions & 0 deletions .github/workflows/R-CMD-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches:
- main
- master
- pre-release
pull_request:
branches:
- main
- master
- pre-release

name: R-CMD-tests

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: macOS-latest, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

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

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
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'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install JAGS (windows-latest)
if: runner.os == 'Windows'
run: |
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe
wjags.exe /S
del wjags.exe
shell: cmd

- name: Install JAGS (macOS-latest)
if: runner.os == 'macOS'
run : |
rm '/usr/local/bin/gfortran'
brew install automake jags
- name: Install and test RoBSA (non-Windows)
if: runner.os != 'Windows'
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
#remotes::install_version("BayesTools", "0.2.10")
remotes::install_github("FBartos/BayesTools@v0.2.10")
install.packages("devtools")
install.packages("testthat")
install.packages("vdiffr")
devtools::install()
library(vdiffr)
library(testthat)
devtools::test()
shell: Rscript {0}"

- name: Install and test RoBSA (Windows)
if: runner.os == 'Windows'
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
JAGS_ROOT: "/c/progra~1/JAGS/JAGS-4.2.0"
JAGS_MAJOR_VERSION: 4
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
#remotes::install_version("BayesTools", "0.2.10")
remotes::install_github("FBartos/BayesTools@v0.2.10")
install.packages("devtools")
install.packages("testthat")
install.packages("vdiffr")
devtools::install()
library(vdiffr)
library(testthat)
devtools::test()
shell: Rscript {0}
91 changes: 91 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
on:
push:
branches:
- main
- master
tags:
-'*'

name: pkgdown

jobs:
pkgdown:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

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

steps:
- uses: actions/checkout@v2

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

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

- name: Install harfbuzz freetype2 fribidi Headers
if: runner.os == 'Linux'
run: sudo apt-get install libharfbuzz-dev libfribidi-dev


- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
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'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install JAGS (windows-latest)
if: runner.os == 'Windows'
run: |
curl.exe -o wjags.exe --url https://deac-fra.dl.sourceforge.net/project/mcmc-jags/JAGS/4.x/Windows/JAGS-4.2.0-Rtools33.exe
wjags.exe /S
del wjags.exe
shell: cmd

- name: Install JAGS (macOS-latest)
if: runner.os == 'macOS'
run : |
rm '/usr/local/bin/gfortran'
brew install automake jags
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown")
#remotes::install_version("BayesTools", "0.2.10")
remotes::install_github("FBartos/BayesTools@v0.2.10")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
Loading

0 comments on commit f11e22f

Please sign in to comment.