Skip to content

Commit

Permalink
UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
davidycliao committed Aug 18, 2024
1 parent 43ff96e commit 651f0b4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 17 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/mac_r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@ jobs:
- name: Install JAGS on macOS
run: brew install jags

- name: Install gfortran for ARM (M1/M2)
- name: Install gcc (includes gfortran)
run: brew install gcc

- name: Ensure gfortran is in PATH
run: |
echo "/opt/homebrew/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/gcc/bin" >> $GITHUB_PATH
- name: Check gfortran installation
run: gfortran --version

- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -43,34 +51,49 @@ jobs:
Rscript -e "install.packages('tinytex')"
Rscript -e "tinytex::install_tinytex()"
- name: Set CRAN mirror
run: |
Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org/'))"
shell: Rscript {0}

- name: Install remotes package
run: |
Rscript -e "install.packages('remotes')"
- name: Install package dependencies
run: |
Rscript -e "install.packages(c('smacof', 'ellipse', 'plyr', 'vegan'), dependencies=TRUE)"
Rscript -e "install.packages(c('smacof', 'vegan'), dependencies = TRUE)"
shell: Rscript {0}

- name: Install basicspace from GitHub
env:
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
GITHUB_PAT: ${{ secrets.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 }}
- name: Install other R package dependencies
run: |
Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org/')); install.packages(c('rjags', 'ggplot2', 'knitr'));"
Rscript -e "install.packages(c('rjags', 'ggplot2', 'knitr'))"
shell: Rscript {0}

- name: Install rcmdcheck package
run: |
Rscript -e "install.packages('rcmdcheck')"
shell: Rscript {0}

- name: Check
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:
R_LIBS_USER: /Users/runner/work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
25 changes: 15 additions & 10 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
branches: [ "master" ]

permissions:
contents: read
contents: read

jobs:
build:
Expand All @@ -34,52 +34,57 @@ jobs:
choco install rtools
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')\"
Rscript -e "install.packages('remotes')"
shell: cmd

- name: Install package dependencies
- name: Install CRAN packages including rjags
run: |
Rscript -e \"install.packages(c('smacof', 'ellipse', 'plyr', 'vegan'))\"
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)\"
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('rjags', 'ggplot2', 'knitr'))\"
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')\"
Rscript -e "install.packages('rcmdcheck')"
shell: cmd

- name: Check
run: |
Rscript -e \"rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')\"
Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')"
shell: cmd

- name: Test (optional)
run: |
Rscript -e \"devtools::test() \"
Rscript -e "devtools::test()"
shell: cmd

env:
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true

0 comments on commit 651f0b4

Please sign in to comment.