SH: #264
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
# 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] | |
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'} | |
- {os: ubuntu-latest, r: 'oldrel-1'} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- 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 | |
# mikl > | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck any::remotes any::reticulate | |
needs: check | |
# https://rstudio.github.io/reticulate/articles/package.html#using-github-actions | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: setup r-reticulate venv | |
shell: Rscript {0} | |
run: | | |
# doBy Github: | |
remotes::install_github('hojsgaard/doby') | |
# reticulate | |
python_packages <- c("numpy", "sympy") | |
library(reticulate) | |
virtualenv_create("r-reticulate", Sys.which("python")) | |
virtualenv_install("r-reticulate", python_packages) | |
path_to_python <- virtualenv_python("r-reticulate") | |
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), | |
Sys.getenv("GITHUB_ENV")) | |
# < mikl | |
- uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
# pkgdown: | |
# runs-on: ubuntu-latest | |
# # Only restrict concurrency for non-PR jobs | |
# concurrency: | |
# group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} | |
# env: | |
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# - uses: r-lib/actions/setup-pandoc@v2 | |
# | |
# - uses: r-lib/actions/setup-r@v2 | |
# with: | |
# use-public-rspm: true | |
# | |
# # mikl > | |
# - uses: r-lib/actions/setup-r-dependencies@v2 | |
# with: | |
# extra-packages: any::pkgdown any::remotes any::reticulate, local::. | |
# needs: website | |
# | |
# # https://rstudio.github.io/reticulate/articles/package.html#using-github-actions | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: "3.x" | |
# | |
# - name: setup r-reticulate venv | |
# shell: Rscript {0} | |
# run: | | |
# # doBy Github: | |
# remotes::install_github('hojsgaard/doby') | |
# | |
# # reticulate | |
# python_packages <- c("numpy", "sympy") | |
# | |
# library(reticulate) | |
# virtualenv_create("r-reticulate", Sys.which("python")) | |
# virtualenv_install("r-reticulate", python_packages) | |
# | |
# path_to_python <- virtualenv_python("r-reticulate") | |
# writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), | |
# Sys.getenv("GITHUB_ENV")) | |
# # < mikl | |
# | |
# - name: Build site | |
# run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | |
# shell: Rscript {0} | |
# | |
# - name: Deploy to GitHub pages 🚀 | |
# if: github.event_name != 'pull_request' | |
# uses: JamesIves/github-pages-deploy-action@v4.4.1 | |
# with: | |
# clean: false | |
# branch: gh-pages | |
# folder: docs | |