Skip to content

Commit 0302b2a

Browse files
committed
replace travis and appveyor with github actions via tic package
1 parent 7ceb4e3 commit 0302b2a

40 files changed

+339
-270
lines changed

.Rbuildignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
^_pkgdown\.yml$
1717
^codemeta\.json$
1818
^CRAN-RELEASE$
19+
^\.ccache$
20+
^\.github$
21+
^tic\.R$

.github/workflows/tic.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
## tic GitHub Actions template: linux-macos-windows-deploy
2+
## revision date: 2023-12-15
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
- cran-*
10+
pull_request:
11+
branches:
12+
- main
13+
- master
14+
# for now, CRON jobs only run on the default branch of the repo (i.e. usually on master)
15+
schedule:
16+
# * is a special character in YAML so you have to quote this string
17+
- cron: "0 4 * * *"
18+
19+
name: tic
20+
21+
jobs:
22+
all:
23+
runs-on: ${{ matrix.config.os }}
24+
25+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
config:
31+
# use a different tic template type if you do not want to build on all listed platforms
32+
- { os: windows-latest, r: "release" }
33+
- { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
34+
- { os: ubuntu-latest, r: "devel" }
35+
- { os: ubuntu-latest, r: "release" }
36+
37+
env:
38+
# make sure to run `tic::use_ghactions_deploy()` to set up deployment
39+
TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }}
40+
# prevent rgl issues because no X11 display is available
41+
RGL_USE_NULL: true
42+
# if you use bookdown or blogdown, replace "PKGDOWN" by the respective
43+
# capitalized term. This also might need to be done in tic.R
44+
BUILD_PKGDOWN: ${{ matrix.config.pkgdown }}
45+
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
46+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- uses: r-lib/actions/setup-r@v2
52+
with:
53+
r-version: ${{ matrix.config.r }}
54+
Ncpus: 4
55+
56+
- uses: r-lib/actions/setup-tinytex@v2
57+
if: matrix.config.latex == 'true'
58+
59+
- uses: r-lib/actions/setup-pandoc@v2
60+
61+
- name: Install sys deps for Ubuntu
62+
if: runner.os == 'Linux'
63+
run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev
64+
65+
# set date/week for use in cache creation
66+
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
67+
# - cache R packages daily
68+
- name: "[Cache] Prepare daily timestamp for cache"
69+
if: runner.os != 'Windows'
70+
id: date
71+
run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT
72+
73+
- name: "[Cache] Restore R package cache"
74+
if: runner.os != 'Windows'
75+
uses: actions/cache/restore@v3
76+
with:
77+
path: ${{ env.R_LIBS_USER }}
78+
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
79+
80+
- name: "[Stage] Install"
81+
run: Rscript -e "install.packages('tic', repos = c('https://ropensci.r-universe.dev', if (grepl('Ubuntu', Sys.info()[['version']])) {sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))} else {'https://cloud.r-project.org'}))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
82+
83+
- name: "[Cache] Save R package cache"
84+
if: runner.os != 'Windows' && always()
85+
uses: actions/cache/save@v3
86+
with:
87+
path: ${{ env.R_LIBS_USER }}
88+
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
89+
90+
- name: "[Stage] Script"
91+
run: Rscript -e 'tic::script()'
92+
93+
- name: "[Stage] After Success"
94+
run: Rscript -e "tic::after_success()"
95+
96+
- name: "[Stage] Upload R CMD check artifacts"
97+
if: failure()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
101+
path: check
102+
- name: "[Stage] Before Deploy"
103+
run: |
104+
Rscript -e "tic::before_deploy()"
105+
106+
- name: "[Stage] Deploy"
107+
run: Rscript -e "tic::deploy()"
108+
109+
- name: "[Stage] After Deploy"
110+
run: Rscript -e "tic::after_deploy()"

.github/workflows/update-tic.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
workflow_dispatch:
3+
schedule:
4+
# * is a special character in YAML so you have to quote this string
5+
- cron: "0 4 * * 0" # every week
6+
7+
name: Update tic
8+
9+
jobs:
10+
update-tic:
11+
runs-on: ${{ matrix.config.os }}
12+
13+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- { os: ubuntu-latest, r: "release" }
20+
21+
env:
22+
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
r-version: ${{ matrix.config.r }}
33+
Ncpus: 4
34+
35+
- name: "[Stage] Dependencies"
36+
run: |
37+
Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"
38+
Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic', dependencies = TRUE)"
39+
40+
- name: "[Stage] Update YAMLs"
41+
run: |
42+
Rscript -e "tic::update_yml()"
43+
44+
- name: "[Stage] Create Pull Request"
45+
uses: peter-evans/create-pull-request@v4
46+
with:
47+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
48+
token: ${{ secrets.TIC_UPDATE }}
49+
title: "Update tic templates [ci-skip]"
50+
commit-message: "update tic templates"
51+
body: "{tic} templates can be updated :rocket: :robot:"
52+
branch: update-tic

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
inst/doc
66
.DS_Store
77
CRAN-RELEASE
8+
docs/

.travis.yml

-15
This file was deleted.

DESCRIPTION

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: hydroscoper
22
Type: Package
33
Title: Interface to the Greek National Data Bank for Hydrometeorological Information
4-
Version: 1.5.0
4+
Version: 1.6.0
55
Authors@R: c(person("Konstantinos", "Vantas",
66
role = c("aut", "cre"),
77
email = "[email protected]",
@@ -24,16 +24,16 @@ Depends: R (>= 3.4)
2424
License: MIT + file LICENSE
2525
Encoding: UTF-8
2626
LazyData: true
27-
RoxygenNote: 7.2.1
28-
Imports: stringi (>= 1.5),
29-
stringr (>= 1.4),
30-
tibble(>= 3.1),
27+
RoxygenNote: 7.3.0
28+
Imports: stringi (>= 1.8),
29+
stringr (>= 1.5),
30+
tibble(>= 3.2),
3131
pingr (>= 2.0),
32-
readr (>= 1.4),
33-
jsonlite (>= 1.7)
32+
readr (>= 2.1),
33+
jsonlite (>= 1.8)
3434
Suggests:
35-
ggplot2 (>= 3.3),
36-
knitr (>= 1.31),
37-
rmarkdown (>= 2.7),
38-
testthat (>= 3.0)
35+
ggplot2 (>= 3.4),
36+
knitr (>= 1.45),
37+
rmarkdown (>= 2.25),
38+
testthat (>= 3.2)
3939
VignetteBuilder: knitr

README.Rmd

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ online <- function(h_url){
2626
chk_online <- online("kyy.hydroscope.gr")
2727
2828
```
29-
30-
[![Travis-CI Build Status](https://travis-ci.org/ropensci/hydroscoper.svg?branch=master)](https://travis-ci.org/ropensci/hydroscoper)
31-
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/ropensci/hydroscoper?branch=master&svg=true)](https://ci.appveyor.com/project/ropensci/hydroscoper)
29+
[![tic](https://github.com/ropensci/hydroscoper/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/hydroscoper/actions)
3230
[![codecov](https://codecov.io/github/ropensci/hydroscoper/branch/master/graphs/badge.svg)](https://codecov.io/gh/ropensci/hydroscoper)
3331
[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/)
3432
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper)

README.md

+25-29
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ hydroscoper
33

44
<!-- README.md is generated from README.Rmd. Please edit that file -->
55

6-
[![Travis-CI Build
7-
Status](https://travis-ci.org/ropensci/hydroscoper.svg?branch=master)](https://travis-ci.org/ropensci/hydroscoper)
8-
[![AppVeyor Build
9-
Status](https://ci.appveyor.com/api/projects/status/github/ropensci/hydroscoper?branch=master&svg=true)](https://ci.appveyor.com/project/ropensci/hydroscoper)
6+
[![tic](https://github.com/ropensci/hydroscoper/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/hydroscoper/actions)
107
[![codecov](https://codecov.io/github/ropensci/hydroscoper/branch/master/graphs/badge.svg)](https://codecov.io/gh/ropensci/hydroscoper)
118
[![minimal R
129
version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/)
@@ -24,13 +21,12 @@ Hydrological and Meteorological Information, *Hydroscope*. For more
2421
details checkout the package’s
2522
[website](https://docs.ropensci.org/hydroscoper/) and the vignettes:
2623

27-
- [An introduction to
28-
`hydroscoper`](https://docs.ropensci.org/hydroscoper/articles/intro_hydroscoper.html)
29-
with details about the Hydroscope project and the package.
30-
- [Using `hydroscoper`’s data
31-
sets](https://docs.ropensci.org/hydroscoper/articles/stations_with_data.html)
32-
with a simple example of how to use the package’s internal data
33-
sets.
24+
- [An introduction to
25+
`hydroscoper`](https://docs.ropensci.org/hydroscoper/articles/intro_hydroscoper.html)
26+
with details about the Hydroscope project and the package.
27+
- [Using `hydroscoper`’s data
28+
sets](https://docs.ropensci.org/hydroscoper/articles/stations_with_data.html)
29+
with a simple example of how to use the package’s internal data sets.
3430

3531
## Installation
3632

@@ -51,19 +47,19 @@ devtools::install_github("ropensci/hydroscoper")
5147

5248
The functions that are provided by `hydroscoper` are:
5349

54-
- `get_stations, get_timeseries, ..., etc.` family functions, to
55-
retrieve tibbles with Hydroscope’s data for a given data source.
56-
- `get_data`, to retrieve a tibble with time series’ values.
57-
- `hydro_coords`, to convert Hydroscope’s points’ raw format to a
58-
tibble.
59-
- `hydro_translate` to translate various terms and names from Greek to
60-
English.
50+
- `get_stations, get_timeseries, ..., etc.` family functions, to
51+
retrieve tibbles with Hydroscope’s data for a given data source.
52+
- `get_data`, to retrieve a tibble with time series’ values.
53+
- `hydro_coords`, to convert Hydroscope’s points’ raw format to a
54+
tibble.
55+
- `hydro_translate` to translate various terms and names from Greek to
56+
English.
6157

6258
The data sets that are provided by `hydroscoper` are:
6359

64-
- `stations` a tibble with stations’ data from Hydroscope.
65-
- `timeseries` a tibble with time series’ data from Hydroscope.
66-
- `greece_borders` a tibble with the borders of Greece.
60+
- `stations` a tibble with stations’ data from Hydroscope.
61+
- `timeseries` a tibble with time series’ data from Hydroscope.
62+
- `greece_borders` a tibble with the borders of Greece.
6763

6864
## Example
6965

@@ -92,7 +88,7 @@ ts_raw
9288
#> 8 1985-05-06 11:30:00 0 1
9389
#> 9 1985-05-06 12:00:00 0 1
9490
#> 10 1985-05-06 12:30:00 0 1
95-
#> # … with 147,509 more rows
91+
#> # 147,509 more rows
9692
```
9793

9894
Let’s create a plot:
@@ -109,13 +105,13 @@ ggplot(data = ts_raw, aes(x = date, y = value))+
109105

110106
## Meta
111107

112-
- Bug reports, suggestions, and code are welcome. Please see
113-
[Contributing](https://github.com/ropensci/hydroscoper/blob/master/CONTRIBUTING.md).
114-
- License:
115-
- All code is licensed MIT.
116-
- All data are from the public data sources in
117-
`http://www.hydroscope.gr/`.
118-
- To cite `hydroscoper` please use:
108+
- Bug reports, suggestions, and code are welcome. Please see
109+
[Contributing](https://github.com/ropensci/hydroscoper/blob/master/CONTRIBUTING.md).
110+
- License:
111+
- All code is licensed MIT.
112+
- All data are from the public data sources in
113+
`http://www.hydroscope.gr/`.
114+
- To cite `hydroscoper` please use:
119115

120116
<!-- -->
121117

appveyor.yml

-45
This file was deleted.

docs/404.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)