From bcfd4b72524bc30c888805d4ee65a4a89f31b34b Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Wed, 23 Dec 2020 13:54:06 +0100 Subject: [PATCH] replaced travis with github actions --- .Rbuildignore | 3 +- .buildlibrary | 3 +- .github/.gitignore | 1 + .github/workflows/test-buildlibrary.yaml | 58 ++++++++++++++++++++++++ .travis.yml | 19 -------- .zenodo.json | 2 +- DESCRIPTION | 11 +++-- README.md | 10 ++-- codecov.yml | 16 +++++++ tests/testthat/test-travisCI.R | 8 ---- 10 files changed, 93 insertions(+), 38 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/test-buildlibrary.yaml delete mode 100644 .travis.yml create mode 100644 codecov.yml delete mode 100644 tests/testthat/test-travisCI.R diff --git a/.Rbuildignore b/.Rbuildignore index 1545323..4eef409 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,8 +1,9 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -.travis.yml ^\.git$ ^.*\.zenodo.json$ ^CRAN-RELEASE$ ^cran-comments\.md$ ^\.buildlibrary$ +^\.github$ +^codecov\.yml$ diff --git a/.buildlibrary b/.buildlibrary index 0c75fc8..cbd527d 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,6 +1,7 @@ -ValidationKey: '1113300' +ValidationKey: '1135759' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' AcceptedNotes: unable to verify current time AutocreateReadme: yes +UseGithubActions: yes diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/test-buildlibrary.yaml b/.github/workflows/test-buildlibrary.yaml new file mode 100644 index 0000000..db67aa6 --- /dev/null +++ b/.github/workflows/test-buildlibrary.yaml @@ -0,0 +1,58 @@ +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: check + +jobs: + check: + runs-on: ubuntu-20.04 + 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: Install dependencies + run: | + sudo apt-get install libcurl4-openssl-dev libgit2-dev + + - 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: Cache R packages + 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 R dependencies + run: | + repos <- c("https://cloud.r-project.org","https://rse.pik-potsdam.de/r/packages/") + install.packages(c("remotes"), repos=repos) + remotes::install_deps(dependencies = TRUE, repos=repos) + remotes::install_cran(c("covr","lucode2"), repos=repos) + shell: Rscript {0} + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} + + - name: Validation key + run: if(!lucode2:::validkey()$valid) stop("Invalid build key!") + shell: Rscript {0} + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3fa150f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - -language: r -os: linux -dist: xenial -repos: - CRAN: https://cloud.r-project.org - PIK: https://rse.pik-potsdam.de/r/packages/ -cache: packages -latex: false -pandoc: false -r_packages: - - devtools - - testthat - - lucode2 -script: - - Rscript -e 'devtools::test()' -after_success: - - Rscript -e 'covr::codecov()' diff --git a/.zenodo.json b/.zenodo.json index 4b9dff2..c9d47fa 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "gms: 'GAMS' Modularization Support Package", - "version": "0.6.0", + "version": "0.6.1", "description": "

A collection of tools to create, use and maintain modularized model code written in the modeling \n language 'GAMS' (). Out-of-the-box 'GAMS' does not come with support for modularized\n model code. This package provides the tools necessary to convert a standard 'GAMS' model to a modularized one\n by introducing a modularized code structure together with a naming convention which emulates local\n environments. In addition, this package provides tools to monitor the compliance of the model code with\n modular coding guidelines.<\/p>", "creators": [ { diff --git a/DESCRIPTION b/DESCRIPTION index 4fabe21..8d905e6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: gms Type: Package Title: 'GAMS' Modularization Support Package -Version: 0.6.0 -Date: 2020-10-20 +Version: 0.6.1 +Date: 2020-12-23 Authors@R: c(person("Jan Philipp", "Dietrich", email = "dietrich@pik-potsdam.de", role = c("aut","cre")), person("David", "Klein", role = "aut"), person("Anastasis", "Giannousakis", role = "aut"), @@ -16,7 +16,12 @@ Description: A collection of tools to create, use and maintain modularized model environments. In addition, this package provides tools to monitor the compliance of the model code with modular coding guidelines. Imports: dplyr, rlang, stringr, yaml -Suggests: curl, magclass, qgraph, testthat +Suggests: + curl, + magclass, + qgraph, + testthat, + covr URL: https://github.com/pik-piam/gms BugReports: https://github.com/pik-piam/gms/issues License: BSD_2_clause + file LICENSE diff --git a/README.md b/README.md index b25c343..d9b17ec 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # 'GAMS' Modularization Support Package -R package **gms**, version **0.6.0** +R package **gms**, version **0.6.1** -[![Travis build status](https://travis-ci.com/pik-piam/gms.svg?branch=master)](https://travis-ci.com/pik-piam/gms) [![codecov](https://codecov.io/gh/pik-piam/gms/branch/master/graph/badge.svg)](https://codecov.io/gh/pik-piam/gms) +[![CRAN status](https://www.r-pkg.org/badges/version/gms)](https://cran.r-project.org/package=gms) [![R build status](https://github.com/pik-piam/gms/workflows/check/badge.svg)](https://github.com/pik-piam/gms/actions) [![codecov](https://codecov.io/gh/pik-piam/gms/branch/master/graph/badge.svg)](https://codecov.io/gh/pik-piam/gms) ## Purpose and Functionality @@ -43,8 +43,8 @@ In case of questions / problems please contact Jan Philipp Dietrich