Skip to content

R-CMD-check

R-CMD-check #204

# 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
# This workflow tests if the package can be installed from github from within
# a github action.
on:
push:
branches:
- main
schedule:
- cron: '0 4 * * *'
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: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'schedule' && github.ref == 'refs/heads/development')
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- name: Install libglpk40
if: ${{ matrix.config.os == 'ubuntu-latest' }}
run: sudo apt-get install -y libglpk40
- name: Install xquartz (Mac OS)
if: ${{ matrix.config.os == 'macos-latest' }}
run: brew install --cask xquartz
- 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: Set R version
run: |
echo "R_VERSION=`R --version | head -n 1 | awk '{print $3}' | cut -b 1-3`" >> $GITHUB_ENV
echo "R_LIBS_USER=`Rscript -e 'cat(.libPaths()[1L])'`" >> $GITHUB_ENV
- name: Set up R dependency cache
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ env.R_VERSION }}
restore-keys: |
${{ runner.os }}-r-${{ env.R_VERSION }}
- name: Install remotes
run: |
Rscript -e 'install.packages("remotes")'
Rscript -e 'remotes::install_github("r-lib/remotes")' # see: https://github.com/r-lib/remotes/issues/798
Rscript -e 'remotes::install_github("ctlab/fgsea")' # see: https://github.com/ctlab/fgsea/issues/165
- name: Install MetaProViz from git by remotes
run: Rscript -e 'remotes::install_github("saezlab/MetaProViz", dependencies = TRUE)' #we install from GitHub as if we are a random user
- name: Build and check package
run: |
R CMD build .
R CMD check *.tar.gz --no-manual