1+ # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+ on :
4+ push :
5+ branches : [main, master]
6+ pull_request :
7+
8+ name : R-CMD-check.yaml
9+
10+ permissions : read-all
11+
12+ jobs :
13+ R-CMD-check :
14+ runs-on : ${{ matrix.config.os }}
15+
16+ name : ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+ strategy :
19+ fail-fast : false
20+ matrix :
21+ config :
22+ - {os: macOS-latest, r: 'release'}
23+ - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+ - {os: ubuntu-latest, r: 'release'}
25+ - {os: ubuntu-latest, r: 'oldrel-1'}
26+ - {os: windows-latest, r: 'release'}
27+
28+ env :
29+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
30+ R_KEEP_PKG_SOURCE : yes
31+
32+ steps :
33+ - uses : actions/checkout@v4
34+
35+ - name : Install system dependencies (Ubuntu)
36+ if : runner.os == 'Linux'
37+ run : |
38+ sudo apt-get update
39+ sudo apt-get install -y libgsl-dev libgsl27
40+
41+ - uses : r-lib/actions/setup-pandoc@v2
42+
43+ - uses : r-lib/actions/setup-r@v2
44+ with :
45+ r-version : ${{ matrix.config.r }}
46+ http-user-agent : ${{ matrix.config.http-user-agent }}
47+ use-public-rspm : true
48+
49+ - name : Install JAGS (macOS)
50+ if : runner.os == 'macOS'
51+ run : |
52+ brew install jags
53+ echo "JAGS_HOME=$(brew --prefix jags)" >> $GITHUB_ENV
54+
55+ - name : Install JAGS (Windows)
56+ if : runner.os == 'Windows'
57+ run : |
58+ # Create a temporary directory for the installer
59+ $tempDir = Join-Path $env:RUNNER_TEMP "jags-installer"
60+ New-Item -ItemType Directory -Path $tempDir -Force
61+
62+ # Download JAGS to the temporary directory
63+ $installerPath = Join-Path $tempDir "JAGS-4.3.1.exe"
64+ curl -LO https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.1.exe
65+ Move-Item -Path "JAGS-4.3.1.exe" -Destination $installerPath
66+
67+ # Install JAGS
68+ Start-Process -FilePath $installerPath -ArgumentList "/S" -NoNewWindow -Wait
69+
70+ # Set environment variable
71+ echo "JAGS_HOME=C:/Program Files/JAGS/JAGS-4.3.1" >> $env:GITHUB_ENV
72+
73+ # Clean up the installer
74+ Remove-Item -Path $tempDir -Recurse -Force
75+ shell : pwsh
76+
77+ - name : Set up JAGS environment (macOS)
78+ if : runner.os == 'macOS'
79+ run : |
80+ echo "JAGS_LIB=$JAGS_HOME/lib" >> $GITHUB_ENV
81+ echo "PKG_CONFIG_PATH=$JAGS_HOME/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
82+ echo "LDFLAGS=-L$JAGS_HOME/lib" >> $GITHUB_ENV
83+ echo "CPPFLAGS=-I$JAGS_HOME/include" >> $GITHUB_ENV
84+ echo "LD_LIBRARY_PATH=$JAGS_HOME/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
85+ echo "DYLD_LIBRARY_PATH=$JAGS_HOME/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
86+ # Create symbolic links for JAGS modules
87+ sudo mkdir -p /usr/local/lib/JAGS/modules-4
88+ for module in basemod bugs terminal; do
89+ sudo ln -sf "$JAGS_HOME/lib/JAGS/modules-4/${module}.so" "/usr/local/lib/JAGS/modules-4/${module}.so"
90+ done
91+
92+ - name : Set up JAGS environment (Windows)
93+ if : runner.os == 'Windows'
94+ run : |
95+ echo "PATH=C:/Program Files/JAGS/JAGS-4.3.1/bin;${env:PATH}" >> $env:GITHUB_ENV
96+ shell : pwsh
97+
98+ - uses : r-lib/actions/setup-r-dependencies@v2
99+ with :
100+ extra-packages : any::rcmdcheck
101+ needs : check
102+
103+ - uses : r-lib/actions/check-r-package@v2
104+ with :
105+ upload-snapshots : true
106+ build_args : ' c("--no-manual","--compact-vignettes=gs+qpdf")'
0 commit comments