Merge branch 'litalbarkai:main' into main #217
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] | |
pull_request: | |
branches: [main] | |
name: R package | |
permissions: read-all | |
jobs: | |
R-CMD-check: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: macos-13, r: 'release', name: 'macos-13-r-release'} | |
- {os: macos-14, r: 'release', name: 'macos-14-r-release'} | |
- {os: ubuntu-latest, r: 'release', name: 'ubuntu-latest-r-release'} | |
- {os: windows-latest, r: 'release', name: 'windows-latest-r-release'} | |
- {os: ubuntu-latest, r: 'devel', name: 'ubuntu-latest-r-devel'} | |
- {os: windows-latest, r: 'devel', name: 'windows-latest-r-devel'} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup R | |
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: Restore R package cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/R | |
key: ${{ runner.os }}-r-${{ matrix.config.r }}-cache | |
- name: Install libpng (macOS) | |
if: matrix.config.os == 'macos-14' && matrix.config.r == 'devel' | |
run: | | |
curl -LO https://mac.r-project.org/bin/darwin20/arm64/libpng-1.6.38-darwin.20-arm64.tar.xz | |
sudo tar -xvf libpng-1.6.38-darwin.20-arm64.tar.xz -C / | |
echo "PKG_CONFIG_PATH=/opt/R/arm64/lib/pkgconfig" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) { install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") }' | |
Rscript -e 'pak::pkg_install("decor", dependencies = TRUE)' | |
Rscript -e 'pak::pkg_install("rcmdcheck", dependencies = TRUE)' | |
Rscript -e 'pak::pkg_install("pkgbuild", dependencies = TRUE)' | |
Rscript -e 'pak::pkg_install(".", dependencies = TRUE)' | |
working-directory: ./rpkg | |
- name: Check | |
run: | | |
Rscript -e 'pkgbuild::check_build_tools(debug = TRUE)' | |
Rscript -e 'rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), build_args = "--no-manual", error_on = "error")' | |
working-directory: ./rpkg | |
- name: Save R package cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/R | |
key: ${{ runner.os }}-r-${{ matrix.config.r }}-cache |