Skip to content

Commit

Permalink
Merge pull request #562 from imbs-hl/gh_actions
Browse files Browse the repository at this point in the history
Add GH actions standard workflow
  • Loading branch information
mnwright committed May 3, 2021
2 parents ce49771 + 8bd52a5 commit 00828ae
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .Rbuildignore
Expand Up @@ -4,6 +4,6 @@
^NEWS\.md$
^README\.md$
^.*\.tar.gz$
^\.travis.yml$
^cpp\_version$
^appveyor\.yml$
^\.github$
^codecov\.yml$
1 change: 1 addition & 0 deletions .github/.gitignore
@@ -0,0 +1 @@
*.html
87 changes: 87 additions & 0 deletions .github/workflows/R-CMD-check.yaml
@@ -0,0 +1,87 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

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: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/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@v1
with:
r-version: ${{ matrix.config.r }}

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

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

- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
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'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: test-coverage

jobs:
test-coverage:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

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

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

- name: Restore R package cache
uses: actions/cache@v2
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 dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions DESCRIPTION
Expand Up @@ -2,7 +2,7 @@ Package: ranger
Type: Package
Title: A Fast Implementation of Random Forests
Version: 0.12.4
Date: 2020-07-24
Date: 2021-05-03
Author: Marvin N. Wright [aut, cre], Stefan Wager [ctb], Philipp Probst [ctb]
Maintainer: Marvin N. Wright <cran@wrig.de>
Description: A fast implementation of Random Forests, particularly suited for high
Expand All @@ -15,7 +15,10 @@ License: GPL-3
Imports: Rcpp (>= 0.11.2), Matrix
LinkingTo: Rcpp, RcppEigen
Depends: R (>= 3.1)
Suggests: survival, testthat
Suggests:
covr,
survival,
testthat
Encoding: UTF-8
RoxygenNote: 7.1.0
URL: https://github.com/imbs-hl/ranger
Expand Down
5 changes: 2 additions & 3 deletions README.md
@@ -1,6 +1,5 @@
[![Travis Build Status](https://travis-ci.org/imbs-hl/ranger.svg?branch=master)](https://travis-ci.org/imbs-hl/ranger)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/imbs-hl/ranger?branch=master&svg=true)](https://ci.appveyor.com/project/mnwright/ranger)
[![Coverage Status](https://coveralls.io/repos/github/imbs-hl/ranger/badge.svg?branch=master)](https://coveralls.io/github/imbs-hl/ranger?branch=master)
[![R-CMD-check](https://github.com/imbs-hl/ranger/workflows/R-CMD-check/badge.svg)](https://github.com/imbs-hl/ranger/actions)
[![Codecov test coverage](https://codecov.io/gh/imbs-hl/ranger/branch/master/graph/badge.svg)](https://codecov.io/gh/imbs-hl/ranger?branch=master)
![CRAN Downloads month](http://cranlogs.r-pkg.org/badges/ranger?color=brightgreen)
![CRAN Downloads overall](http://cranlogs.r-pkg.org/badges/grand-total/ranger?color=brightgreen)
## ranger: A Fast Implementation of Random Forests
Expand Down
42 changes: 0 additions & 42 deletions appveyor.yml

This file was deleted.

14 changes: 14 additions & 0 deletions codecov.yml
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
1 change: 0 additions & 1 deletion src/Forest.cpp
Expand Up @@ -144,7 +144,6 @@ void Forest::initR(std::unique_ptr<Data> input_data, uint mtry, uint num_trees,
uint num_random_splits, bool order_snps, uint max_depth, const std::vector<double>& regularization_factor,
bool regularization_usedepth) {

this->memory_mode = memory_mode;
this->verbose_out = verbose_out;

// Call other init function
Expand Down

0 comments on commit 00828ae

Please sign in to comment.