Skip to content

R-CMD-check

R-CMD-check #334

Workflow file for this run

on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0"
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: windows-latest, r: "4.1", cache-version: 2 }
- { os: windows-latest, r: "4.2", cache-version: 2 }
- {
os: ubuntu-20.04,
r: "4.2",
rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
cache-version: 2,
}
# - {
# os: ubuntu-20.04,
# r: "4.2",
# rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
# cache-version: 3,
# }
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.os }}-${{ matrix.config.r }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v2
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-${{ matrix.config.cache-version }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-${{ matrix.config.cache-version }}-
- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
sudo apt install libgtk2.0-dev xorg-dev libxml2-dev libnlopt-dev \
libcurl4-openssl-dev \
libudunits2-dev libgdal-dev libgeos-dev libproj-dev \
libcgal-dev libglu1-mesa-dev
- name: Install RGtk2
if: runner.os == 'Windows'
run: ./.github/install_gtk.cmd
shell: bash
- name: Add GTK to PATH
if: runner.os == 'Windows'
run: echo "${{env.R_LIBS_USER}}\RGtk2\gtk\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check RGtk2
if: runner.os == 'Windows'
run: |
library(RGtk2)
gtkWindowNew()
shell: Rscript {0}
- name: Install dependencies
env:
OS_TYPE: ${{ runner.os }}
uses: GabrielBB/xvfb-action@v1.2
with:
run: Rscript ./.github/install_deps.R
- name: Create iNZightVIT directory
if: runner.os == 'Windows'
run: try(dir.create(file.path("~", "Documents", "iNZightVIT", "modules"), recursive = TRUE))
shell: Rscript {0}
- name: Check
uses: GabrielBB/xvfb-action@v1.0
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
with:
run: Rscript -e "rcmdcheck::rcmdcheck(args = c('--no-manual', '--no-multiarch'), error_on = 'warning', check_dir = 'check')"
- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check