Skip to content

[r] Prepare package for CRAN #60

[r] Prepare package for CRAN

[r] Prepare package for CRAN #60

name: R-CMD-check
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
R-CMD-check:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
ENABLE_INSTALL_COUNTING: no
_R_CHECK_BUILD_VIGNETTES_: false
steps:
- uses: actions/checkout@v4
- name: Install binary dependencies on ubuntu
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev libhwy-dev
sudo apt-get isntall -y libhwy-dev || true
- name: Install binary dependencies on macOS
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
shell: bash
run: |
brew update
brew install hdf5 pkg-config highway
- name: Configure compilation flags
shell: bash
run: |
cat <<'MAKEVARS' > "$GITHUB_WORKSPACE/Makevars.user"
MAKEFLAGS=--jobs=3
MAKEVARS
echo "R_MAKEVARS_USER=$GITHUB_WORKSPACE/Makevars.user" >> "$GITHUB_ENV"
- name: Install Highway on Windows (MSYS2 UCRT64)
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
release: false
update: true
cache: true
install: >-
base-devel
git
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-highway
msystem: UCRT64
path-type: minimal
- name: Expose UCRT64 pkg-config to PATH (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
echo "C:/msys64/ucrt64/bin" >> $GITHUB_PATH
# Ensure pkg-config finds the .pc files for UCRT64
echo "PKG_CONFIG_PATH=C:/msys64/ucrt64/lib/pkgconfig" >> $GITHUB_ENV
echo "PKG_CONFIG=C:/msys64/ucrt64/bin/pkg-config.exe" >> $GITHUB_ENV
- name: Handle Windows big object files
if: matrix.os == 'windows-latest'
shell: bash
run: |
echo "CXXFLAGS += -Wa,-mbig-obj" >> "$GITHUB_WORKSPACE/Makevars.user"
- uses: r-lib/actions/setup-r@v2
with:
Ncpus: '3'
use-public-rspm: true
extra-repositories: |
https://bioconductor.org/packages/release/data/annotation
https://bpcells.github.io/drat
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
any::testthat
any::decor
working-directory: 'r'
needs: check
- name: Check package
uses: r-lib/actions/check-r-package@v2
with:
working-directory: r
build_args: c("--no-build-vignettes")
upload-snapshots: false
error-on: '"error"'