Add R GitHub action file (#12868)

* fix travis, update rbuildignore

* add comment
This commit is contained in:
William Cheng 2022-07-15 15:31:22 +08:00 committed by GitHub
parent ca4a86ea55
commit a3269a0569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 0 deletions

View File

@ -250,6 +250,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
supportingFiles.add(new SupportingFile("api_client.mustache", File.separator + "R", "api_client.R")); supportingFiles.add(new SupportingFile("api_client.mustache", File.separator + "R", "api_client.R"));
supportingFiles.add(new SupportingFile("NAMESPACE.mustache", "", "NAMESPACE")); supportingFiles.add(new SupportingFile("NAMESPACE.mustache", "", "NAMESPACE"));
supportingFiles.add(new SupportingFile("testthat.mustache", File.separator + "tests", "testthat.R")); supportingFiles.add(new SupportingFile("testthat.mustache", File.separator + "tests", "testthat.R"));
supportingFiles.add(new SupportingFile("r-client.mustache", File.separator + ".github" + File.separator + "workflows", "r-client.yaml"));
// add lambda for mustache templates to fix license field // add lambda for mustache templates to fix license field
additionalProperties.put("lambdaLicense", new Mustache.Lambda() { additionalProperties.put("lambdaLicense", new Mustache.Lambda() {

View File

@ -6,6 +6,7 @@ cache:
r_packages: r_packages:
- jsonlite - jsonlite
- httr - httr
- testthat
# uncomment below to install deps with devtools # uncomment below to install deps with devtools
#install: #install:
#- R -e 'devtools::install_deps(dep = T)' #- R -e 'devtools::install_deps(dep = T)'

View File

@ -11,6 +11,7 @@
^\.gitignore$ ^\.gitignore$
^\.openapi-generator-ignore$ ^\.openapi-generator-ignore$
^\.travis\.yml$ ^\.travis\.yml$
^\.github$
^\.openapi-generator$ ^\.openapi-generator$
^docs$ ^docs$
^git_push\.sh$ ^git_push\.sh$

View File

@ -0,0 +1,26 @@
# This file is automatically generated by openapi-generator (https://openapi-generator.tech)
#
# Based on https://github.com/r-lib/actions/tree/v2/examples
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2

View File

@ -11,6 +11,7 @@
^\.gitignore$ ^\.gitignore$
^\.openapi-generator-ignore$ ^\.openapi-generator-ignore$
^\.travis\.yml$ ^\.travis\.yml$
^\.github$
^\.openapi-generator$ ^\.openapi-generator$
^docs$ ^docs$
^git_push\.sh$ ^git_push\.sh$

View File

@ -0,0 +1,26 @@
# This file is automatically generated by openapi-generator (https://openapi-generator.tech)
#
# Based on https://github.com/r-lib/actions/tree/v2/examples
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2

View File

@ -1,4 +1,5 @@
.Rbuildignore .Rbuildignore
.github/workflows/r-client.yaml
.gitignore .gitignore
.travis.yml .travis.yml
DESCRIPTION DESCRIPTION

View File

@ -6,6 +6,7 @@ cache:
r_packages: r_packages:
- jsonlite - jsonlite
- httr - httr
- testthat
# uncomment below to install deps with devtools # uncomment below to install deps with devtools
#install: #install:
#- R -e 'devtools::install_deps(dep = T)' #- R -e 'devtools::install_deps(dep = T)'