From 1e425c0fe5eea9cf8521f50edbda035b2e3b8ba5 Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 7 Aug 2020 14:30:04 +0200 Subject: [PATCH 1/6] switch to GHA --- .Rbuildignore | 2 + .github/workflows/tic.yml | 120 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 67 --------------------- appveyor.yml | 28 --------- 4 files changed, 122 insertions(+), 95 deletions(-) create mode 100644 .github/workflows/tic.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.Rbuildignore b/.Rbuildignore index a893d73b4..bf9c4222c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ ^tic\.R$ ^_pkgdown\.yml$ ^docs$ +^\.ccache$ +^\.github$ diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml new file mode 100644 index 000000000..2ffad9639 --- /dev/null +++ b/.github/workflows/tic.yml @@ -0,0 +1,120 @@ +## tic GitHub Actions template: linux-macos-windows-deploy +## revision date: 2020-07-29 +on: + push: + pull_request: + # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) + schedule: + # * is a special character in YAML so you have to quote this string + - cron: "0 4 * * *" + +name: tic + +jobs: + all: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + # use a different tic template type if you do not want to build on all listed platforms + - { os: windows-latest, r: "release" } + - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" } + - { os: ubuntu-latest, r: "devel" } + - { os: ubuntu-latest, r: "release" } + + env: + # otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + CRAN: ${{ matrix.config.cran }} + # make sure to run `tic::use_ghactions_deploy()` to set up deployment + TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }} + # prevent rgl issues because no X11 display is available + RGL_USE_NULL: true + # if you use bookdown or blogdown, replace "PKGDOWN" by the respective + # capitalized term. This also might need to be done in tic.R + BUILD_PKGDOWN: ${{ matrix.config.pkgdown }} + # macOS >= 10.15.4 linking + SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk + # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2.3.1 + + - uses: r-lib/actions/setup-r@master + with: + r-version: ${{ matrix.config.r }} + Ncpus: 4 + + # LaTeX. Installation time: + # Linux: ~ 1 min + # macOS: ~ 1 min 30s + # Windows: never finishes + - uses: r-lib/actions/setup-tinytex@master + if: matrix.config.latex == 'true' + + - uses: r-lib/actions/setup-pandoc@master + + # set date/week for use in cache creation + # https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970 + # - cache R packages daily + - name: "[Cache] Prepare daily timestamp for cache" + if: runner.os != 'Windows' + id: date + run: echo "::set-output name=date::$(date '+%d-%m')" + + - name: "[Cache] Cache R packages" + if: runner.os != 'Windows' + uses: pat-s/always-upload-cache@v2.1.0 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} + restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} + + # for some strange Windows reason this step and the next one need to be decoupled + - name: "[Stage] Prepare" + run: | + Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" + Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')" + + - name: "[Stage] [Linux] Install curl" + if: runner.os == 'Linux' + run: sudo apt install libcurl4-openssl-dev + + - name: "[Stage] Install" + if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel' + run: Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + + # macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries + - name: "[Stage] Prepare & Install (macOS-devel)" + if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel' + run: | + echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile + Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + + - name: "[Stage] Script" + run: Rscript -e 'tic::script()' + + - name: "[Stage] After Success" + if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release' + run: Rscript -e "tic::after_success()" + + - name: "[Stage] Upload R CMD check artifacts" + if: failure() + uses: actions/upload-artifact@v2.1.1 + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check + - name: "[Stage] Before Deploy" + run: | + Rscript -e "tic::before_deploy()" + + - name: "[Stage] Deploy" + run: Rscript -e "tic::deploy()" + + - name: "[Stage] After Deploy" + run: Rscript -e "tic::after_deploy()" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b0bbec5d5..000000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Default configuration for use with tic package -# tic documentation to get started: https://ropenscilabs.github.io/tic/ - -# DO NOT CHANGE THE CODE BELOW -before_install: - - R -q -e 'if (!requireNamespace("remotes")) install.packages("remotes")' - - R -q -e 'if (getRversion() < "3.2" && !requireNamespace("curl")) install.packages("curl")' - - R -q -e 'remotes::install_github("ropenscilabs/tic", upgrade = "always"); print(tic::dsl_load()); tic::prepare_all_stages()' - - R -q -e 'tic::before_install()' -install: R -q -e 'tic::install()' -before_script: R -q -e 'tic::before_script()' -script: R -q -e 'tic::script()' -after_success: R -q -e 'tic::after_success()' -after_failure: R -q -e 'tic::after_failure()' -before_deploy: R -q -e 'tic::before_deploy()' -deploy: - provider: script - script: R -q -e 'tic::deploy()' - on: - all_branches: true -after_deploy: R -q -e 'tic::after_deploy()' -after_script: R -q -e 'tic::after_script()' -# DO NOT CHANGE THE CODE ABOVE - -# Custom parts: - -# Header -language: r -sudo: false -dist: bionic -cache: - - packages - - $HOME/.ccache -latex: false - -#stages: test, full -stages: -- name: test -- name: full - if: branch = master - -#jobs -jobs: - include: - - r: devel - env: - - TIC_DEV_VERSIONS=TRUE - - r: 3.2 - - stage: full - os: osx - - r: release - env: - - TIC_BUILD_PKGDOWN=true - - r: 3.5 - - r: 3.4 - - r: 3.3 - fast_finish: true - -#env -env: - global: - - _R_CHECK_FORCE_SUGGESTS_=false - - _R_CHECK_SYSTEM_CLOCK_=false - - MAKEFLAGS="-j 2" - -#services -services: diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 1259fc99b..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -# tic documentation to get started: https://ropenscilabs.github.io/tic/ - -# Download script file from GitHub -init: - ps: | - $ErrorActionPreference = "Stop" - Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" - Import-Module '..\appveyor-tool.ps1' - -install: - - ps: Bootstrap - - cmd: Rscript -e "writeLines('options(repos = \'https://cloud.r-project.org\')', '~/.Rprofile')" - - cmd: Rscript -e "getOption('repos')" - - cmd: Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'binary')" - - cmd: Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'binary')" - - cmd: Rscript -e "options(pkgType = 'binary'); remotes::install_github('ropenscilabs/tic', upgrade = 'always'); print(tic::dsl_load()); tic::prepare_all_stages()" - -before_build: Rscript -e "tic::before_install()" -build_script: Rscript -e "tic::install()" -after_build: Rscript -e "tic::after_install()" -before_test: Rscript -e "tic::before_script()" -test_script: Rscript -e "tic::script()" -on_success: Rscript -e "try(tic::after_success(), silent = TRUE)" -on_failure: Rscript -e "tic::after_failure()" -before_deploy: Rscript -e "tic::before_deploy()" -deploy_script: Rscript -e "tic::deploy()" -after_deploy: Rscript -e "tic::after_deploy()" -on_finish: Rscript -e "tic::after_script()" From a6c0650ce65ad580bd2815f16c4917f655aaa6d7 Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 7 Aug 2020 14:32:05 +0200 Subject: [PATCH 2/6] use latest template version --- .github/workflows/tic.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 2ffad9639..dcd34eaf6 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -1,6 +1,7 @@ ## tic GitHub Actions template: linux-macos-windows-deploy -## revision date: 2020-07-29 +## revision date: 2020-08-06 on: + workflow_dispatch: push: pull_request: # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) From 3ce3886658d7b4f39a0b4040dba9eaea34d8b91b Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 7 Aug 2020 14:46:04 +0200 Subject: [PATCH 3/6] fix tibble import --- DESCRIPTION | 9 +++++---- NAMESPACE | 1 + R/import.R | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cc7f64d17..9899a90b6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,11 +4,11 @@ Version: 0.0.3.9006 Date: 2020-05-26 Authors@R: person(given = "Kirill", - family = "M\u00fcller", + family = "Müller", role = c("aut", "cre"), email = "krlmlr+r@mailbox.org") -Description: Streamlines the process of versioning R - packages and updating NEWS. Numbers are cheap, why not use them? +Description: Streamlines the process of versioning R packages + and updating NEWS. Numbers are cheap, why not use them? License: GPL-3 URL: http://krlmlr.github.io/fledge, https://github.com/krlmlr/fledge @@ -20,6 +20,7 @@ Imports: purrr (>= 0.3.2), rematch2, rlang, + tibble, usethis (>= 1.5.0), withr Suggests: @@ -34,4 +35,4 @@ VignetteBuilder: Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 diff --git a/NAMESPACE b/NAMESPACE index 1221234e2..95c8eb2dc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,3 +17,4 @@ importFrom(purrr,map) importFrom(purrr,map_chr) importFrom(purrr,map_int) importFrom(purrr,some) +importFrom(tibble,add_column) diff --git a/R/import.R b/R/import.R index 539b65480..3d20c78e3 100644 --- a/R/import.R +++ b/R/import.R @@ -1,3 +1,4 @@ #' @import rlang #' @importFrom purrr map map_chr map_int discard keep some +#' @importFrom tibble add_column NULL From 9d9b71f3ac5e6d9d104b2963c6c33c1a586ef90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 14 Aug 2020 06:06:19 +0200 Subject: [PATCH 4/6] Escape --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9899a90b6..eccab6cbf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Version: 0.0.3.9006 Date: 2020-05-26 Authors@R: person(given = "Kirill", - family = "Müller", + family = "M\u00fcller", role = c("aut", "cre"), email = "krlmlr+r@mailbox.org") Description: Streamlines the process of versioning R packages From e67d04d20d5cdaa241defcd1ebcbfc63554c89b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 14 Aug 2020 06:13:34 +0200 Subject: [PATCH 5/6] Run only on main branch --- .github/workflows/tic.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index dcd34eaf6..66088f927 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -3,7 +3,11 @@ on: workflow_dispatch: push: + branches: + - master pull_request: + branches: + - master # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) schedule: # * is a special character in YAML so you have to quote this string From 5980fadc3eff30b083e6e2e873f7cb8c716b9eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 14 Aug 2020 06:42:23 +0200 Subject: [PATCH 6/6] Don't restrict pull requests on which to run --- .github/workflows/tic.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 66088f927..3a53db965 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -6,8 +6,6 @@ on: branches: - master pull_request: - branches: - - master # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) schedule: # * is a special character in YAML so you have to quote this string