Skip to content

Commit 31b5fa2

Browse files
authored
Added new action for CI pipeline (#16)
* Create cran.yml (#15) * Upped version number * Ignore github actions folder * Updated manuals using Roxygen2 * Added virtual deconstructor to prevent memory leak * Cleaned compiler flags * Adjusted testthat catch entrypoint to new definition * Added DS_Store to gitignore * Added DS_Store to gitignore * Create codecov.yml * Added covr, not running all tests yet * LTO warnings - deleted extra ;
1 parent 497d658 commit 31b5fa2

21 files changed

+256
-67
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
^\.travis\.yml$
22
^.*\.Rproj$
33
^\.Rproj\.user$
4+
.github
5+
.covrignore

.covrignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
inst

.github/workflows/codecov.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: codecov
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the dev branch
8+
push:
9+
branches: [ dev ]
10+
pull_request:
11+
branches: [ dev ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
jobs:
17+
test-coverage:
18+
runs-on: macOS-latest
19+
env:
20+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- uses: r-lib/actions/setup-r@v1
25+
26+
- name: Query dependencies
27+
run: |
28+
install.packages('remotes')
29+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
30+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
31+
shell: Rscript {0}
32+
33+
- name: Cache R packages
34+
uses: actions/cache@v2
35+
with:
36+
path: ${{ env.R_LIBS_USER }}
37+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
38+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
39+
40+
- name: Install dependencies
41+
run: |
42+
install.packages(c("remotes"))
43+
remotes::install_deps(dependencies = TRUE)
44+
remotes::install_cran("covr")
45+
shell: Rscript {0}
46+
47+
- name: Test coverage
48+
run: covr::codecov()
49+
shell: Rscript {0}

.github/workflows/cran.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: ${{ matrix.config.os }}
18+
19+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
config:
25+
- {os: windows-latest, r: 'release'}
26+
- {os: macOS-latest, r: 'release'}
27+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28+
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
29+
30+
env:
31+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32+
RSPM: ${{ matrix.config.rspm }}
33+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
- uses: r-lib/actions/setup-r@v1
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
42+
- uses: r-lib/actions/setup-pandoc@v1
43+
44+
- name: Query dependencies
45+
run: |
46+
install.packages('remotes')
47+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
49+
shell: Rscript {0}
50+
51+
- name: Cache R packages
52+
if: runner.os != 'Windows'
53+
uses: actions/cache@v2
54+
with:
55+
path: ${{ env.R_LIBS_USER }}
56+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
58+
59+
- name: Install system dependencies
60+
if: runner.os == 'Linux'
61+
run: |
62+
while read -r cmd
63+
do
64+
eval sudo $cmd
65+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
66+
67+
- name: Install dependencies
68+
run: |
69+
remotes::install_deps(dependencies = TRUE)
70+
remotes::install_cran("rcmdcheck")
71+
shell: Rscript {0}
72+
73+
- name: Check
74+
env:
75+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
76+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
77+
shell: Rscript {0}
78+
79+
- name: Upload check results
80+
if: failure()
81+
uses: actions/upload-artifact@main
82+
with:
83+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
84+
path: check

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
*.o
99
*.gcno
1010
.Rproj.user
11+
.DS_Store

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: ANN2
22
Type: Package
33
Title: Artificial Neural Networks for Anomaly Detection
4-
Version: 2.3.3
5-
Date: 2020-03-14
4+
Version: 2.3.4
5+
Date: 2020-11-29
66
Author: Bart Lammers
77
Maintainer: Bart Lammers <[email protected]>
88
Description: Training of neural networks for classification and regression tasks
@@ -26,4 +26,4 @@ Imports: Rcpp (>= 0.12.18), reshape2 (>= 1.4.3), ggplot2 (>= 3.0.0),
2626
viridisLite (>= 0.3.0), methods
2727
LinkingTo: Rcpp, RcppArmadillo, testthat
2828
Suggests: testthat
29-
RoxygenNote: 6.1.1
29+
RoxygenNote: 7.1.1

R/catch-routine-registration.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# 'tools::package_native_routine_registration_skeleton()' generates the required
33
# registration info for the 'run_testthat_tests' symbol.
44
(function() {
5-
.Call("run_testthat_tests", PACKAGE = "ANN2")
5+
.Call("run_testthat_tests", FALSE, PACKAGE = "ANN2")
66
})

R/plotting.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11

22
#' @title Plot training and validation loss
33
#' @description \code{plot} Generate plots of the loss against epochs
4-
#' @details A genereric function for training neural nets
4+
#' @details A generic function for plot loss of neural net
55
#' @method plot ANN
66
#' @param x Object of class \code{ANN}
77
#' @param max.points Maximum number of points to plot, set to NA, NULL or Inf to
88
#' include all points in the plot
99
#' @param ... further arguments to be passed to plot
1010
#' @return Plots
11-
#' @method plot ANN
1211
#' @export
1312
plot.ANN <- function(x, max.points = 1000, ...) {
1413

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
2-
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/ANN2)](https://cran.r-project.org/package=ANN2) ![](http://cranlogs.r-pkg.org/badges/grand-total/ANN2?color=green) ![](http://cranlogs.r-pkg.org/badges/last-week/ANN2?color=green)
3-
[![Travis build status](https://travis-ci.org/bflammers/ANN2.svg?branch=master)](https://travis-ci.org/bflammers/ANN2)
4-
[![codecov](https://codecov.io/gh/bflammers/ANN2/branch/master/graph/badge.svg)](https://codecov.io/gh/bflammers/ANN2)
2+
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/ANN2)](https://cran.r-project.org/package=ANN2)
3+
![Monthly downloads](https://cranlogs.r-pkg.org/badges/ANN2)
4+
![R CMD check](https://github.com/bflammers/ANN2/workflows/R-CMD-check/badge.svg)
5+
[![codecov](https://codecov.io/gh/bflammers/ANN2/branch/dev/graph/badge.svg)](https://codecov.io/gh/bflammers/ANN2)
56

67
# ANN2
78
Artificial Neural Networks package for R

man/autoencoder.Rd

Lines changed: 24 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)