Skip to content

Commit 63eddea

Browse files
authored
Feature GitHub actions (#988)
* add github actions * use single quotes * ignore the github dir * fix docs * skipping while #986 is not solved * mistakenly left the tuple here * install certificates * use http to avoid ssl error in CI * install requests and certifi * install certifi * install urllib3 * use https * test different file * use function * remove travis and appveyor.yml * add github actions badge * remove mention to multiple backends * schedule daily runs
1 parent 687d341 commit 63eddea

File tree

10 files changed

+77
-170
lines changed

10 files changed

+77
-170
lines changed

.Rbuildignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
^.travis\.yml$
3333
^Jenkinsfile$
3434
^logo.png$
35-
35+
^\.github.*$
3636
^appveyor\.yml$
3737
^CRAN-RELEASE$
3838
^doc$

.github/workflows/main.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
push:
3+
pull_request:
4+
schedule:
5+
- cron: '0 1 * * *'
6+
7+
name: R-CMD-check
8+
9+
jobs:
10+
R-CMD-check:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: ['windows-latest', 'macOS-latest', 'ubuntu-16.04']
15+
tf: ['1.14.0', '1.15.2', '2.0.1', '2.1.0', 'nightly']
16+
include:
17+
- os: ubuntu-16.04
18+
cran: https://demo.rstudiopm.com/all/__linux__/xenial/latest
19+
- tf: nightly
20+
allow_failure: true
21+
runs-on: ${{ matrix.os }}
22+
name: ${{ matrix.os }} (TF ${{ matrix.tf }})
23+
env:
24+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
25+
TF_VERSION: ${{ matrix.tf }}
26+
PIP_NO_WARN_SCRIPT_LOCATION: false
27+
RETICULATE_AUTOCONFIGURE: 'FALSE'
28+
CRAN: ${{ matrix.cran }}
29+
30+
steps:
31+
- uses: actions/checkout@v1
32+
- uses: r-lib/actions/setup-r@master
33+
- uses: r-lib/actions/setup-pandoc@master
34+
- name: Install system dependencies
35+
if: runner.os == 'Linux'
36+
env:
37+
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
38+
run: |
39+
Rscript -e "install.packages('remotes')" -e "remotes::install_github('r-hub/sysreqs')"
40+
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
41+
sudo -s eval "$sysreqs"
42+
- name: Install dependencies
43+
run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')"
44+
- name: Install Python
45+
run: |
46+
Rscript -e "remotes::install_github('rstudio/reticulate')"
47+
Rscript -e "reticulate::install_miniconda()"
48+
Rscript -e "reticulate::conda_create('r-reticulate', packages = c('python==3.6.9'))"
49+
- name: Install TensorFlow
50+
run: |
51+
Rscript -e "remotes::install_local()"
52+
Rscript -e "keras::install_keras(tensorflow = Sys.getenv('TF_VERSION'), extra_packages = c('IPython', 'requests', 'certifi', 'urllib3'))"
53+
- name: Check
54+
continue-on-error: ${{ contains(matrix.allow_failure, 'true') }}
55+
run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')"

.travis.yml

Lines changed: 0 additions & 106 deletions
This file was deleted.

R/layers-normalization.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#' @param renorm_clipping A named list or dictionary that may map keys `rmax`,
3232
#' `rmin`, `dmax` to scalar Tensors used to clip the renorm correction. The
3333
#' correction `(r, d)` is used as `corrected_value = normalized_value * r + d`,
34-
#' with `r` clipped to [rmin, rmax], and `d` to [-dmax, dmax]. Missing `rmax`,
34+
#' with `r` clipped to `[rmin, rmax]`, and `d` to `[-dmax, dmax]`. Missing `rmax`,
3535
#' `rmin`, `dmax` are set to `Inf`, `0`, `Inf`, `respectively`.
3636
#' @param renorm_momentum Momentum used to update the moving means and standard
3737
#' deviations with renorm. Unlike momentum, this affects training and should

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
![](https://s3.amazonaws.com/keras.io/img/keras-logo-2018-large-1200.png)
44

5-
[![Travis-CI Build Status](https://travis-ci.org/rstudio/keras.svg?branch=master)](https://travis-ci.org/rstudio/keras)
6-
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/rstudio/keras?branch=master&svg=true)](https://ci.appveyor.com/project/rstudio/keras)
5+
[![R build status](https://github.com/rstudio/keras/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/keras/actions?workflow=R-CMD-check)
76
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/keras)](http://cran.r-project.org/package=keras)
87
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/fchollet/keras/blob/master/LICENSE)
98

@@ -17,7 +16,5 @@
1716

1817
- Supports arbitrary network architectures: multi-input or multi-output models, layer sharing, model sharing, etc. This means that Keras is appropriate for building essentially any deep learning model, from a memory network to a neural Turing machine.
1918

20-
- Is capable of running on top of multiple back-ends including [TensorFlow](https://github.com/tensorflow/tensorflow), [CNTK](https://github.com/Microsoft/cntk), or [Theano](https://github.com/Theano/Theano).
21-
22-
See the package website at <https://keras.rstudio.com> for complete documentation.
19+
See the package website at <https://tensorflow.rstudio.com> for complete documentation.
2320

appveyor.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

man/layer_batch_normalization.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-callbacks.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ expect_warns_and_out <- function(warns, out) {
161161

162162
test_succeeds("on predict/evaluation callbacks", {
163163

164+
if (tensorflow::tf_version() >= "2.1")
165+
skip("TODO: R based generators are not working with TF >= 2.1")
166+
164167
CustomCallback <- R6::R6Class(
165168
"CustomCallback",
166169
inherit = KerasCallback,

tests/testthat/test-generators.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ test_succeeds("image data generator can be used for training", {
7070

7171
test_succeeds("R function can be used as custom generator", {
7272

73+
if (tensorflow::tf_version() >= "2.1")
74+
skip("TODO: R based generators are not working with TF >= 2.1")
75+
7376
# create model
7477
library(keras)
7578
model <- keras_model_sequential()
@@ -121,6 +124,9 @@ test_succeeds("R function can be used as custom generator", {
121124

122125
test_succeeds("R function can be used as custom generator with multiple inputs", {
123126

127+
if (tensorflow::tf_version() >= "2.1")
128+
skip("TODO: R based generators are not working with TF >= 2.1")
129+
124130
input1 <- layer_input(shape = 1)
125131
input2 <- layer_input(shape = 1)
126132

@@ -142,6 +148,9 @@ test_succeeds("R function can be used as custom generator with multiple inputs",
142148

143149
test_succeeds("Fixed validation_data instead of generator with fit_generator", {
144150

151+
if (tensorflow::tf_version() >= "2.1")
152+
skip("TODO: R based generators are not working with TF >= 2.1")
153+
145154
input1 <- layer_input(shape = 1)
146155
input2 <- layer_input(shape = 1)
147156

@@ -165,6 +174,9 @@ test_succeeds("Fixed validation_data instead of generator with fit_generator", {
165174

166175
test_succeeds("Can use a custom preprocessing function in image_data_generator", {
167176

177+
if (tensorflow::tf_version() >= "2.1")
178+
skip("TODO: R based generators are not working with TF >= 2.1")
179+
168180
img_gen <- image_data_generator(preprocessing_function = function(x) x/255)
169181

170182
mnist <- dataset_mnist()

tests/testthat/test-utils.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ test_call_succeeds("to_categorical", {
1111

1212

1313
test_call_succeeds("get_file", {
14-
get_file("2010zipcode.zip",
15-
origin = "https://www.irs.gov/pub/irs-soi/2010zipcode.zip",
14+
get_file("im.jpg",
15+
origin = "https://camo.githubusercontent.com/0d08dc4f9466d347e8d28a951ea51e3430c6f92c/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6b657261732e696f2f696d672f6b657261732d6c6f676f2d323031382d6c617267652d313230302e706e67",
1616
cache_subdir = "tests")
1717
})
1818

0 commit comments

Comments
 (0)