UPDATE #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 JAGS on macOS | |
run: brew install jags | |
- name: Install LaTeX on macOS | |
run: brew install --cask mactex-no-gui | |
- name: Set up R ${{ matrix.r-version }} | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.r-version }} | |
- name: Set CRAN mirror and install R package dependencies | |
env: | |
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }} # 使用新的 Secret 名称 MY_GITHUB_PAT | |
run: | | |
Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org/')); install.packages(c('remotes', 'rjags', 'ggplot2', 'knitr'));" | |
Rscript -e "remotes::install_github('cran/basicspace')" | |
- name: Install rcmdcheck package | |
run: | | |
Rscript -e "install.packages('rcmdcheck')" | |
- name: Check | |
run: | | |
Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')" | |
- name: Test (optional) | |
run: | | |
Rscript -e "devtools::test()" |