-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (54 loc) · 1.76 KB
/
test-coverage.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
name: test-coverage
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'}
steps:
- uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
# 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 devtools
- name: Install devtools
run: |
install.packages('devtools')
# Set up renv
- name: Setup renv
uses: r-lib/actions/setup-renv@v2
# Install the package
- name: Install the required packages
run: |
install.packages('rcmdcheck')
install.packages(c('BayesFactor', 'runjags', 'rjags', 'rstan', 'scales', 'vdiffr', 'testthat', 'covr', 'pandoc'))
devtools::install()
shell: Rscript {0}
# Run the coverage check
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}