Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/131 Enable R-CMD-check on Git-Hub Actions #159

Merged
merged 7 commits into from
Jun 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
129 changes: 129 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
on:
push:
branches:
- release
- master
- develop

pull_request:
branches:
- release
- master
- develop

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: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps("./hyperSpec", dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('./hyperSpec/DESCRIPTION'))")
sudo -s eval "$sysreqs"

- name: Install dependencies
run: |
remotes::install_deps("./hyperSpec", dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("devtools")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Roxygenize
run: |
devtools::document(
"./hyperSpec",
roclets = c('rd', 'collate', 'namespace', 'vignette')
)
shell: Rscript {0}

- name: Check
if: matrix.config.r != 'devel'
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
rcmdcheck::rcmdcheck(
"./hyperSpec",
args = c("--no-manual", "--as-cran"),
error_on = "warning",
check_dir = "check"
)
shell: Rscript {0}

- name: Check (R-devel)
if: matrix.config.r == 'devel'
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
rcmdcheck::rcmdcheck(
"./hyperSpec",
args = c("--no-manual", "--as-cran"),
error_on = "error",
check_dir = "check"
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
working-directory: ./hyperSpec

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
41 changes: 10 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,6 @@
*.idx
*.ind

hyperSpec/NAMESPACE
hyperSpec/data/*.rda
hyperSpec/R/sysdata.rda
hyperSpec/vignettes/*.Rnw
hyperSpec/vignettes/vignettes.defs
hyperSpec/vignettes/read.txt.PerkinElmer.R
hyperSpec/vignettes/fig-3D.png
hyperSpec/vignettes/hyperspec.bib
hyperSpec/vignettes/functions.RData
hyperSpec/vignettes/rawdata
hyperSpec/inst/doc/*.pdf
hyperSpec/inst/doc/vignettes.defs
hyperSpec/inst/doc/rawdata
hyperSpec/vignettes/rawdata
hyperSpec/vignettes/strukturhyperspec.pdf
hyperSpec/man/*.Rd
Vignettes/*/*.pdf
Vignettes/*/*.png
Vignettes/*/vignettes.defs
Vignettes/chondro/rawdata/
Vignettes/flu/read.txt.PerkinElmer.R
Vignettes/fileio/wdf.Renishaw/WdfAccess
Vignettes/flu/rawdata/flu*.txt
Vignettes/plotting/plotting-pkg.bib
Vignettes/laser/rawdata/*
hyperSpec/vignettes/chondro.pdf*
hyperSpec/vignettes/fileio.pdf*


hyperSpec_*.tar.gz
*.Rcheck

Expand All @@ -65,11 +36,19 @@ hyperSpec_*.tar.gz
.Rproj.user
*.Rproj

# Rnw vignettes
Vignettes/*/*-pkg.bib
Vignettes/*/*.pdf
Vignettes/*/*.png
Vignettes/*/vignettes.defs
Vignettes/chondro/chondro-internal.rda
Vignettes/chondro/rawdata/
Vignettes/fileio/barbiturates.rda
Vignettes/fileio/paracetamol.rda
Vignettes/fileio/wdf.Renishaw/WdfAccess
Vignettes/flu/flu.rda
Vignettes/flu/rawdata/flu*.txt
Vignettes/flu/read.txt.PerkinElmer.R
Vignettes/laser/laser.rda
hyperSpec/tests/testthat/Rplots.pdf
hyperSpec/tests/testthat/fileio
Vignettes/laser/rawdata/*
Vignettes/plotting/plotting-pkg.bib
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# hyperSpec

<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/hyperSpec)](https://cran.r-project.org/package=hyperSpec)
[![R build status](https://github.com/cbeleites/hyperSpec/workflows/R-CMD-check/badge.svg)](https://github.com/cbeleites/hyperSpec/actions)
<!-- badges: end -->

This is the new home for R package hyperSpec.

This is the new home for R package **hyperSpec**.

Issues and feature requests should go [here](https://github.com/cbeleites/hyperSpec/issues)!

Expand Down
8 changes: 7 additions & 1 deletion hyperSpec/.Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
^\.Rproj\.user$
Makefile
tests/testthat/fileio
Rplots.pdf
Rplots.pdf
^CONTRIBUTING\.md$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
^data-raw$
31 changes: 31 additions & 0 deletions hyperSpec/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# Example code in package build process
*-Ex.R

# Mac directory files
*.DS_Store

# RStudio files
.Rproj.user
*.Rproj

# Local pkgdown files
docs

# Unit tests
tests/testthat/Rplots.pdf
tests/testthat/fileio

# Vignettes
vignettes/*-pkg.bib
vignettes/resources/*.bib

# Documentation
man/*.Rd
NAMESPACE
20 changes: 10 additions & 10 deletions hyperSpec/R/chondro.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.make.chondro <- function() {
new("hyperSpec",
spc = (tcrossprod(.chondro.scores, .chondro.loadings) +
rep(.chondro.center, each = nrow(.chondro.scores))),
wavelength = .chondro.wl,
data = .chondro.extra, labels = .chondro.labels
)
}
# .make.chondro <- function() {
# new("hyperSpec",
# spc = (tcrossprod(.chondro.scores, .chondro.loadings) +
# rep(.chondro.center, each = nrow(.chondro.scores))),
# wavelength = .chondro.wl,
# data = .chondro.extra, labels = .chondro.labels
# )
# }
# delayedAssign("chondro", .make.chondro())

##' Raman spectra of 2 Chondrocytes in Cartilage
##' A Raman-map (laterally resolved Raman spectra) of chondrocytes in
Expand All @@ -22,7 +23,6 @@
##' @author A. Bonifacio and C. Beleites
##' @keywords datasets
##' @references The raw data is available at \url{http://hyperspec.r-forge.r-project.org/blob/chondro.zip}
##' @export chondro
##' @examples
##'
##'
Expand All @@ -48,4 +48,4 @@
##' plotmap (chondro[, , c( 728, 782, 1098, 1240, 1482, 1577)],
##' col.regions = colorRampPalette (c ("white", "gold", "dark green"), space = "Lab") (20))
##'
delayedAssign("chondro", .make.chondro())
NULL
Binary file added hyperSpec/data/barbiturates.rda
Binary file not shown.
Binary file added hyperSpec/data/chondro.rda
Binary file not shown.
Binary file added hyperSpec/data/flu.rda
Binary file not shown.
Binary file added hyperSpec/data/laser.rda
Binary file not shown.
Binary file added hyperSpec/data/paracetamol.rda
Binary file not shown.