Skip to content

Commit

Permalink
update windows jags
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenkewu committed Dec 15, 2023
1 parent d2c6d97 commit 37a0bf6
Showing 1 changed file with 31 additions and 60 deletions.
91 changes: 31 additions & 60 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
on: [push, pull_request]

name: R-CMD-check
name: check

jobs:
R-CMD-check:
check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
Expand All @@ -18,46 +14,32 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'release', rtools: ''}
- {os: windows-latest, r: 'release', rtools: '42'}
- {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'devel', rtools: '' , http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release', rtools: ''}
# - {os: ubuntu-latest, r: 'oldrel-1', rtools: ''}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
JAGS_HOME: 'C:\JAGS-4.3.0.exe'
NOT_CRAN: true
R_KEEP_PKG_SOURCE: yes
R_REMOTES_NO_ERRORS_FROM_WARNINGS: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
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}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
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 (ubuntu)
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
- name: Install jags (windows-latest) - most windows system dependencies
- name: Install most Windows system dependencies
if: runner.os == 'Windows'
run: |
pacman -Syu mingw-w64-x86_64-make --noconfirm
Expand All @@ -67,38 +49,27 @@ jobs:
Get-Command mingw32-make | Select-Object -ExpandProperty Definition
(New-Object System.Net.WebClient).DownloadFile('https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Windows/JAGS-4.3.0.exe', 'C:\JAGS-4.3.0.exe')
shell: powershell
- name: Install JAGS on (windows-latest)

- name: Install JAGS on Windows
if: runner.os == 'Windows'
run: C:\JAGS-4.3.0.exe /S
shell: cmd

- name: Install jags (macOS-latest)
- name: Install Mac system dependencies
if: runner.os == 'macOS'
run : |
brew install jags
- name: Install JAGS (ubuntu-latest)
if: runner.os == 'ubuntu'
run: |
sudo apt-get update -y
sudo apt-get install -y jags
- name: Install dependencies
run: brew install jags

- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
sudo apt-get update
sudo apt-get install libglpk-dev libglpk40 jags libv8-dev libnode-dev libcurl4-openssl-dev
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true

0 comments on commit 37a0bf6

Please sign in to comment.