forked from davidaarmstrong/asmcjr
-
Notifications
You must be signed in to change notification settings - Fork 1
173 lines (142 loc) · 4.89 KB
/
mac_r.yml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
name: R Package CI for macOS
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
os: [macos-latest]
r-version: ['4.1.1']
steps:
- uses: actions/checkout@v4
- name: Install system dependencies on macOS
run: |
brew install jags
brew install --cask mactex-no-gui
brew install gfortran
shell: bash
- name: Create symbolic link for gfortran
run: |
sudo mkdir -p /opt/R/arm64/bin
sudo ln -s $(which gfortran) /opt/R/arm64/bin/gfortran
shell: bash
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Install remotes package
run: |
Rscript -e "install.packages('remotes')"
shell: Rscript {0}
- name: Install package dependencies
run: |
Rscript -e "install.packages(c('smacof', 'ellipse', 'plyr', 'vegan'))"
shell: Rscript {0}
- name: Install basicspace from GitHub
env:
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
run: |
Rscript -e "remotes::install_github('cran/basicspace', force = TRUE)"
shell: Rscript {0}
- name: Set CRAN mirror and install other R package dependencies
env:
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
run: |
Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org/')); install.packages(c('rjags', 'ggplot2', 'knitr'));"
shell: Rscript {0}
- name: Install rcmdcheck package
run: |
Rscript -e "install.packages('rcmdcheck')"
shell: Rscript {0}
- name: Run R CMD check
env:
PATH: /opt/homebrew/opt/gcc/bin:/opt/homebrew/bin:$PATH
run: |
Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')"
shell: Rscript {0}
- name: Test (optional)
run: |
Rscript -e "devtools::test()"
shell: Rscript {0}
env:
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: false
NOT_CRAN: true
build-windows:
runs-on: windows-latest
strategy:
matrix:
os: [windows-latest]
r-version: ['4.1.1']
steps:
- uses: actions/checkout@v4
- name: Download and install JAGS
run: |
Invoke-WebRequest -Uri "https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.0.exe/download" -OutFile "JAGS-4.3.0.exe"
if (Test-Path -Path ".\JAGS-4.3.0.exe") {
Start-Process -FilePath ".\JAGS-4.3.0.exe" -ArgumentList '/S' -NoNewWindow -Wait
} else {
Write-Error "Failed to download JAGS installer."
}
shell: powershell
- name: Add JAGS to PATH
run: |
echo "C:\Program Files\JAGS\JAGS-4.3.0\bin" >> $GITHUB_PATH
shell: cmd
- name: Verify JAGS installation
run: jags --version
shell: cmd
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Install remotes package
run: Rscript -e 'install.packages("remotes")'
shell: /bin/bash -e {0}
- name: Install CRAN packages including rjags
run: |
Rscript -e "options(repos = 'https://cloud.r-project.org/')"
Rscript -e "install.packages('rjags')"
Rscript -e "install.packages(c('smacof', 'ellipse', 'plyr', 'vegan'), dependencies=TRUE)"
shell: cmd
- name: Install basicspace from GitHub
env:
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
run: |
Rscript -e "remotes::install_github('cran/basicspace', force = TRUE)"
shell: cmd
- name: Set CRAN mirror and install other R package dependencies
env:
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
run: |
Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org/')); install.packages(c('ggplot2', 'knitr'));"
shell: cmd
- name: Install rcmdcheck package
run: |
Rscript -e "install.packages('rcmdcheck')"
shell: cmd
- name: Check
run: |
Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')"
shell: cmd
- name: Test (optional)
run: |
Rscript -e "devtools::test()"
shell: cmd
env:
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: false
NOT_CRAN: true