-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (119 loc) · 4.16 KB
/
R-CMD-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: R-CMD-check
on:
push:
branches: [main, master, pre-release]
pull_request:
branches: [main, master, pre-release]
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
steps:
- uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
# Install JAGS and system dependencies on Linux
- name: Install System Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libssl-dev \
libcurl4-openssl-dev \
libxml2-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libcairo2-dev \
jags
# Install JAGS on Windows
- name: Install JAGS (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
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
# Set JAGS environment variables on Windows
- name: Set JAGS environment variables (Windows)
if: runner.os == 'Windows'
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%
# Install JAGS on macOS
- name: Install JAGS (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install jags
# Find and Set JAGS Paths
- name: Set Environment Variables (macOS)
if: runner.os == 'macOS'
run: |
JAGS_BIN=$(brew --prefix jags)/bin
echo "JAGS_ROOT=$(brew --prefix jags)" >> $GITHUB_ENV
echo "PATH=$JAGS_BIN:$PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$(brew --prefix jags)/lib/pkgconfig" >> $GITHUB_ENV
# Create Symlink for jags-terminal (if necessary)
- name: Create Symlink for jags-terminal (macOS)
if: runner.os == 'macOS'
run: |
sudo mkdir -p $(brew --prefix)/libexec
sudo ln -s $(brew --prefix jags)/bin/jags $(brew --prefix)/libexec/jags-terminal
# Set up renv
- name: Setup renv
uses: r-lib/actions/setup-renv@v2
# Install the package
- name: Install devtools and the RoBMA Package
run: |
install.packages('devtools')
install.packages('rcmdcheck')
install.packages(c('BayesFactor', 'runjags', 'rjags', 'rstan', 'scales', 'vdiffr', 'testthat', 'covr', 'pandoc'))
devtools::install()
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.3.1"
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