Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
Github Action
  • Loading branch information
davidycliao committed Oct 4, 2023
1 parent 48878ea commit 2f5ebac
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 78 deletions.
130 changes: 90 additions & 40 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,118 @@
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
# on:
# push:
# branches: [main, master]
# pull_request:
# branches: [main, master]
#
# name: R-CMD-check
#
# jobs:
# R-CMD-check:
# runs-on: ${{ matrix.config.os }}
#
# name: ${{ matrix.config.os }} (${{ matrix.config.r }})
#
# strategy:
# fail-fast: false
# matrix:
# config:
# - {os: macos-latest, r: 'release'}
# - {os: windows-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
# - {os: ubuntu-latest, r: 'release'}
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# R_KEEP_PKG_SOURCE: yes
#
# steps:
# - uses: actions/checkout@v2
#
# - uses: r-lib/actions/setup-pandoc@v2
#
#
# - name: Setup Python (Only on ubuntu-latest)
# if: matrix.config.os == 'ubuntu-latest'
# uses: actions/setup-python@v2
# with:
# python-version: '3.x'
#
# - name: Install Python venv and dependencies (Only on ubuntu-latest)
# if: matrix.config.os == 'ubuntu-latest'
# run: |
# sudo apt-get update
# sudo apt-get install -y python3-venv
# python -m venv ~/.venv
# echo "RETICULATE_PYTHON=~/.venv/bin/python" >> $GITHUB_ENV
# source ~/.venv/bin/activate
# - uses: r-lib/actions/setup-r@v2
# with:
# r-version: ${{ matrix.config.r }}
# http-user-agent: ${{ matrix.config.http-user-agent }}
# use-public-rspm: true
#
# - name: Install reticulate (Only on ubuntu-latest)
# if: matrix.config.os == 'ubuntu-latest'
# run: |
# Rscript -e "install.packages('reticulate', repos = 'https://cloud.r-project.org/')"
# - uses: r-lib/actions/setup-r-dependencies@v2
# with:
# extra-packages: any::rcmdcheck
# needs: check
#
# - uses: r-lib/actions/check-r-package@v2
# with:
# upload-snapshots: true
#


on:
push:
branches: [main, master]
branches:
- main
pull_request:
branches: [main, master]
branches:
- main

name: R-CMD-check

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

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'devel'}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

steps:
- uses: actions/checkout@v2

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


- name: Setup Python (Only on ubuntu-latest)
if: matrix.config.os == 'ubuntu-latest'
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install Python venv and dependencies (Only on ubuntu-latest)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y python3-venv
python -m venv ~/.venv
echo "RETICULATE_PYTHON=~/.venv/bin/python" >> $GITHUB_ENV
source ~/.venv/bin/activate
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install reticulate (Only on ubuntu-latest)
if: matrix.config.os == 'ubuntu-latest'
- uses: r-lib/actions/setup-pandoc@v2

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
Rscript -e "install.packages('reticulate', repos = 'https://cloud.r-project.org/')"
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
sudo apt-get update
sudo apt-get install -y python3-venv libpython3-dev
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
- name: Install R dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
- name: Check package
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}
76 changes: 38 additions & 38 deletions .github/workflows/r2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.

name: R

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: macos-latest
strategy:
matrix:
r-version: ['4.0.0', '4.1.0', '4.1.1']
steps:
- uses: actions/checkout@v3
- name: Install pandoc
run: |
brew install pandoc
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.r-version }}
- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}
# name: R
#
# on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
#
# permissions:
# contents: read
#
# jobs:
# build:
# runs-on: macos-latest
# strategy:
# matrix:
# r-version: ['4.0.0', '4.1.0', '4.1.1']
# steps:
# - uses: actions/checkout@v3
#
# - name: Install pandoc
# run: |
# brew install pandoc
#
# - name: Set up R ${{ matrix.r-version }}
# uses: r-lib/actions/setup-r@v1
# with:
# r-version: ${{ matrix.r-version }}
#
# - name: Install dependencies
# run: |
# install.packages(c("remotes", "rcmdcheck"))
# remotes::install_deps(dependencies = TRUE)
# shell: Rscript {0}
#
# - name: Check
# run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
# shell: Rscript {0}

0 comments on commit 2f5ebac

Please sign in to comment.