-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
138 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,67 @@ | ||
name: pkgdown | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
-'*' | ||
|
||
name: pkgdown | ||
- '*' | ||
|
||
jobs: | ||
pkgdown: | ||
build: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
- {os: windows-latest, r: 'release'} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- name: Install harfbuzz freetype2 fribidi Headers | ||
if: runner.os == 'Linux' | ||
run: sudo apt-get install libharfbuzz-dev libfribidi-dev | ||
|
||
|
||
- name: Query dependencies | ||
# Install JAGS on Windows | ||
- name: Install JAGS (Windows) | ||
if: runner.os == 'Windows' | ||
shell: cmd | ||
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} | ||
curl -o jags-installer.exe -L https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.1.exe/download | ||
jags-installer.exe /S | ||
del jags-installer.exe | ||
- 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) | ||
# Set JAGS environment variables on Windows | ||
- name: Set JAGS environment variables (Windows) | ||
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.3.1.exe | ||
wjags.exe /S | ||
del wjags.exe | ||
shell: cmd | ||
run: | | ||
echo JAGS_ROOT=C:\Program Files\JAGS\JAGS-4.3.1>> %GITHUB_ENV% | ||
echo JAGS_MAJOR_VERSION=4>> %GITHUB_ENV% | ||
echo PATH=C:\Program Files\JAGS\JAGS-4.3.1\bin;%PATH%>> %GITHUB_ENV% | ||
# Set up renv | ||
- name: Setup renv | ||
uses: r-lib/actions/setup-renv@v2 | ||
|
||
- name: Install JAGS (macOS-latest) | ||
if: runner.os == 'macOS' | ||
run : | | ||
rm '/usr/local/bin/gfortran' | ||
brew install automake jags | ||
- name: Install dependencies | ||
# Install Pandoc | ||
- name: Setup Pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
# Install the package and its dependencies | ||
- name: Install devtools and the RoBMA Package | ||
run: | | ||
remotes::install_deps(dependencies = TRUE) | ||
install.packages("pkgdown") | ||
install.packages('devtools') | ||
install.packages('pkgdown') | ||
install.packages(c('BayesFactor', 'runjags', 'rjags', 'rstan', 'scales', 'vdiffr', 'testthat', 'covr', 'pandoc')) | ||
devtools::install() | ||
shell: Rscript {0} | ||
|
||
- name: Install package | ||
run: R CMD INSTALL . | ||
|
||
- name: Deploy package | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' |
Oops, something went wrong.