Skip to content

Commit

Permalink
Update Workflows (#35)
Browse files Browse the repository at this point in the history
* add release-based workflows

* update installation instructions

* render README

* use development mode for pages

* Apply suggestions from code review

Co-authored-by: Evan Ray <elray1@users.noreply.github.com>

---------

Co-authored-by: Evan Ray <elray1@users.noreply.github.com>
  • Loading branch information
zkamvar and elray1 authored Sep 24, 2024
1 parent 002c9a6 commit 84ee0c5
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 33 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
schedule:
- cron: "47 14 * * 1" # <=== Set to run at 14:47 on Mondays (avoiding 00:00 and top of the hour runs gives us a better chance for getting server time)

name: R-CMD-check

Expand All @@ -29,22 +32,35 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4
- id: checkout
uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2
- name: Setup for Hotfix/Release Testing
id: release-setup
if: "${{ contains(github.event.pull_request.head.ref, '/hotfix/') || contains(github.event.pull_request.head.ref, '/release/') }}"
run: |
# remove the remote declarations from the DESCRIPTION so that we
# test the released version
sed -i -e '/ hubverse-org/d' DESCRIPTION
- uses: r-lib/actions/setup-r@v2
- id: setup-pandoc
uses: r-lib/actions/setup-pandoc@v2

- id: setup-r
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-repositories: https://hubverse-org.r-universe.dev

- uses: r-lib/actions/setup-r-dependencies@v2
- id: fetch-dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
- id: check
uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
1 change: 1 addition & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: https://hubverse-org.r-universe.dev

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down
22 changes: 17 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ output: github_document

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

```{r, include = FALSE}
```{r, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
Expand All @@ -13,13 +13,14 @@ knitr::opts_chunk$set(
)
```


# hubExamples <a href="https://hubverse-org.github.io/hubExamples/"><img src="man/figures/logo.png" align="right" height="131" alt="hubExamples website" /></a>

<!-- badges: start -->

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/hubExamples)](https://CRAN.R-project.org/package=hubExamples)
[![R-CMD-check](https://github.com/hubverse-org/hubExamples/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hubverse-org/hubExamples/actions/workflows/R-CMD-check.yaml)

<!-- badges: end -->

The goal of hubExamples is to provide example data for forecasting and scenario modeling hubs in the hubverse format.
Expand All @@ -28,9 +29,19 @@ This package is part of the [hubverse](https://hubverse.io/en/latest/) ecosystem

## Installation

You can install the development version of hubExamples from [GitHub](https://github.com/) with:
### Latest

You can install the [latest version of hubExamples from the R-universe](https://hubverse-org.r-universe.dev/hubExamples):

```r
install.packages("hubExamples", repos = c("https://hubverse-org.r-universe.dev", "https://cloud.r-project.org"))
```

``` r
### Development

If you want to test out new features that have not yet been released, you can install the development version of hubExamples from [GitHub](https://github.com/) with:

```r
# install.packages("remotes")
remotes::install_github("hubverse-org/hubExamples")
```
Expand Down Expand Up @@ -64,8 +75,9 @@ head(scenario_target_ts)

Please note that the hubExamples package is released with a [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.


## Contributing

Interested in contributing back to the open-source Hubverse project?
Learn more about how to [get involved in the Hubverse Community](https://hubverse.io/en/latest/overview/contribute.html) or [how to contribute to the hubExamples package](.github/CONTRIBUTING.md).


55 changes: 33 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,31 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
[![CRAN
status](https://www.r-pkg.org/badges/version/hubExamples)](https://CRAN.R-project.org/package=hubExamples)
[![R-CMD-check](https://github.com/hubverse-org/hubExamples/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hubverse-org/hubExamples/actions/workflows/R-CMD-check.yaml)

<!-- badges: end -->

The goal of hubExamples is to provide example data for forecasting and
scenario modeling hubs in the hubverse format.

This package is part of the
[hubverse](https://hubverse.io/en/latest/) ecosystem, which
aims to provide a set of tools for infectious disease modeling hubs to
share and collaborate on their work.
This package is part of the [hubverse](https://hubverse.io/en/latest/)
ecosystem, which aims to provide a set of tools for infectious disease
modeling hubs to share and collaborate on their work.

## Installation

You can install the development version of hubExamples from
### Latest

You can install the [latest version of hubExamples from the
R-universe](https://hubverse-org.r-universe.dev/hubExamples):

``` r
install.packages("hubExamples", repos = c("https://hubverse-org.r-universe.dev", "https://cloud.r-project.org"))
```

### Development

If you want to test out new features that have not yet been released,
you can install the development version of hubExamples from
[GitHub](https://github.com/) with:

``` r
Expand All @@ -40,20 +52,20 @@ package documentation for further information about these data objects.
``` r
library(hubExamples)
head(forecast_outputs)
#> model_id location reference_date horizon target_end_date
#> 1 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 2 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 3 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 4 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 5 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> 6 Flusight-baseline 48 2022-12-17 0 2022-12-17
#> target output_type output_type_id value
#> 1 wk flu hosp rate cdf 0.25 7.592233e-13
#> 2 wk flu hosp rate cdf 0.5 4.736251e-12
#> 3 wk flu hosp rate cdf 0.75 2.767176e-11
#> 4 wk flu hosp rate cdf 1 1.514312e-10
#> 5 wk flu hosp rate cdf 1.25 7.762725e-10
#> 6 wk flu hosp rate cdf 1.5 3.728055e-09
#> model_id reference_date target horizon location
#> 1 Flusight-baseline 2022-11-19 wk inc flu hosp 0 25
#> 2 Flusight-baseline 2022-11-19 wk inc flu hosp 0 25
#> 3 Flusight-baseline 2022-11-19 wk inc flu hosp 0 25
#> 4 Flusight-baseline 2022-11-19 wk inc flu hosp 0 25
#> 5 Flusight-baseline 2022-11-19 wk inc flu hosp 0 25
#> 6 Flusight-baseline 2022-11-19 wk inc flu hosp 0 25
#> target_end_date output_type output_type_id value
#> 1 2022-11-19 quantile 0.05 22
#> 2 2022-11-19 quantile 0.1 31
#> 3 2022-11-19 quantile 0.25 45
#> 4 2022-11-19 quantile 0.5 51
#> 5 2022-11-19 quantile 0.75 57
#> 6 2022-11-19 quantile 0.9 71
head(forecast_target_ts)
#> date location observation
#> 1 2020-01-11 01 0
Expand Down Expand Up @@ -124,6 +136,5 @@ project, you agree to abide by its terms.

Interested in contributing back to the open-source Hubverse project?
Learn more about how to [get involved in the Hubverse
Community](https://hubverse.io/en/latest/overview/contribute.html)
or [how to contribute to the hubExamples
package](.github/CONTRIBUTING.md).
Community](https://hubverse.io/en/latest/overview/contribute.html) or
[how to contribute to the hubExamples package](.github/CONTRIBUTING.md).
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
url: https://hubverse-org.github.io/hubExamples/
template:
package: hubStyle
development:
mode: auto

0 comments on commit 84ee0c5

Please sign in to comment.