From b7f1a2035564ee544075c9c8a0a9a495c66f1b18 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Mon, 30 Dec 2019 14:27:04 -0600 Subject: [PATCH] Switch from TravisCI to GitHub Actions (#17) * Remove TravisCI * Enable GitHub Actions for package checks * Enable GitHub Actions for PR slash commands for documentation and styling. * Block CRAN-RELEASE * Disable code coverage * Change README Badge * Update release notes * Roll development * Prevent the GitHub directory from being included in the package. --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 82 ++++++++++++++++++++++++++++++ .github/workflows/pr-commands.yaml | 47 +++++++++++++++++ .gitignore | 1 + .travis.yml | 46 ----------------- ChangeLog | 6 +++ DESCRIPTION | 2 +- NEWS.md | 4 ++ README.md | 5 +- 9 files changed, 145 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .github/workflows/pr-commands.yaml delete mode 100644 .travis.yml diff --git a/.Rbuildignore b/.Rbuildignore index e60a8b1..97afe9f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,4 @@ ^\.travis\.yml$ ^cran-comments\.md$ ^inst/scripts/.*$ +^\.github$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..745ee00 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,82 @@ +on: + push: + branches: + - master + pull_request: + branches: + - 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: '3.6'} + - { os: macOS-latest, r: '3.6'} + - { os: macOS-latest, r: 'devel'} + - { os: macOS-latest, r: 'release'} + - { os: ubuntu-16.04, r: '3.3', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + - { os: ubuntu-16.04, r: '3.4', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + - { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + - { os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + CRAN: ${{ matrix.config.cran }} + MAKEFLAGS: "-j 2" + R_BUILD_ARGS: "--no-build-vignettes" + R_CHECK_ARGS: "--no-build-vignettes" + _R_CHECK_FORCE_SUGGESTS: 0 + + steps: + - uses: actions/checkout@v1 + + - uses: r-lib/actions/setup-r@master + with: + r-version: ${{ matrix.config.r }} + + - uses: r-lib/actions/setup-pandoc@master + + - name: Query dependencies + run: Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds')" + + - name: Cache R packages + if: runner.os != 'Windows' + uses: actions/cache@v1 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }} + restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- + + - 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('DESCRIPTION'))") + sudo -s eval "$sysreqs" + - name: Install dependencies + run: Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')" + + - name: Check + run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', 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 + + #- name: Test coverage + # if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release' + # run: | + # Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")' diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml new file mode 100644 index 0000000..2b2eebc --- /dev/null +++ b/.github/workflows/pr-commands.yaml @@ -0,0 +1,47 @@ +on: + issue_comment: + types: [created] +name: Commands +jobs: + document: + if: startsWith(github.event.comment.body, '/document') + name: document + runs-on: macOS-latest + steps: + - uses: actions/checkout@v1 + - uses: r-lib/actions/pr-fetch@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: r-lib/actions/setup-r@master + - name: Install dependencies + run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)' + - name: Document + run: Rscript -e 'roxygen2::roxygenise()' + - name: commit + run: | + git add man/\* NAMESPACE + git commit -m 'Document' + - uses: r-lib/actions/pr-push@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + style: + if: startsWith(github.event.comment.body, '/style') + name: document + runs-on: macOS-latest + steps: + - uses: actions/checkout@master + - uses: r-lib/actions/pr-fetch@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: r-lib/actions/setup-r@master + - name: Install dependencies + run: Rscript -e 'install.packages("styler")' + - name: style + run: Rscript -e 'styler::style_pkg()' + - name: commit + run: | + git add \*.R + git commit -m 'style' + - uses: r-lib/actions/pr-push@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 6643042..1434964 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ src/*.o src/*.so src/*.dll inst/doc +CRAN-RELEASE diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b5423e9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - -###### Default build via devtools::use_travis() - -language: r -sudo: false -cache: packages - -###### Custom Options - -# Containers have 2 CPUs by default. Speed up the build by using both. -# c.f. https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system -env: - global: - - MAKEFLAGS="-j 2" - - R_BUILD_ARGS="--no-build-vignettes" - - R_CHECK_ARGS="--no-build-vignettes" - - _R_CHECK_FORCE_SUGGESTS=0 - -# Enable a build matrix that individually tests the package against the -# appropriate operating systems. -matrix: - include: - - os: linux - r: oldrel - - os: linux - r: release - - os: linux - r: devel - - os: osx - r: oldrel - - os: osx - r: release - - os: osx - r: devel - -# Enable a fast finish if any job in the matrix fails. -# c.f. https://blog.travis-ci.com/2013-11-27-fast-finishing-builds -matrix: - - fast_finish: true - -# Set notification options -notifications: - email: - on_success: change - on_failure: change diff --git a/ChangeLog b/ChangeLog index 4f0256d..53e3a41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-12-30 James Balamuta + + * .github/workflows/R-CMD-check.yaml: Added github actions for package checks. + + * .github/workflows/pr-commands.yaml: Enabled slash commands for documentation. + 2019-09-30 James Balamuta * vignettes/using-rcppensmallen.Rmd: Improved wording. diff --git a/DESCRIPTION b/DESCRIPTION index 9bef4e8..69b09da 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: RcppEnsmallen Title: Header-Only C++ Mathematical Optimization Library for 'Armadillo' -Version: 0.2.10.3.1 +Version: 0.2.10.3.2 Authors@R: c( person("James Joseph", "Balamuta", email = "balamut2@illinois.edu", role = c("aut", "cre", "cph"), diff --git a/NEWS.md b/NEWS.md index 089051e..74b9057 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# RcppEnsmallen 0.2.y.z.1 + +- Switched deployment from TravisCI to GitHub Actions. + # RcppEnsmallen 0.2.10.3.1 - Upgraded to ensmallen 2.10.3: "Fried Chicken" (2019-09-26) diff --git a/README.md b/README.md index 9003f53..08ac2f9 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # RcppEnsmallen -[![Build Status](https://travis-ci.org/coatless/rcppensmallen.svg)](https://travis-ci.org/coatless/rcppensmallen) + +[![Build status](https://github.com/coatless/rcppensmallen/workflows/R-CMD-check/badge.svg)](https://github.com/coatless/rcppensmallen/actions) [![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](https://www.gnu.org/licenses/gpl-2.0.html) [![CRAN](https://www.r-pkg.org/badges/version/RcppEnsmallen)](https://cran.r-project.org/package=RcppEnsmallen) [![Downloads](https://cranlogs.r-pkg.org/badges/RcppEnsmallen?color=brightgreen)](https://www.r-pkg.org/pkg/RcppEnsmallen) - + ## Overview