Skip to content

Commit 839e902

Browse files
authored
Merge pull request #35 from R4EPI/clean_document
clean up documenation and github actions
2 parents d7199f9 + e723906 commit 839e902

File tree

11 files changed

+2694
-449
lines changed

11 files changed

+2694
-449
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 24 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# NOTE: This workflow is overkill for most R packages
2-
# check-standard.yaml is likely a better choice
3-
# usethis::use_github_action("check-standard") will install it.
4-
#
5-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
73
on:
84
push:
9-
branches:
10-
- master
5+
branches: [main, master]
116
pull_request:
12-
branches:
13-
- master
7+
branches: [main, master]
148

15-
name: R-CMD-check
9+
name: R-CMD-check.yaml
10+
11+
permissions: read-all
1612

1713
jobs:
1814
R-CMD-check:
@@ -24,85 +20,33 @@ jobs:
2420
fail-fast: false
2521
matrix:
2622
config:
27-
- {os: macOS-latest, cov: 'true', r: 'release'}
28-
- {os: windows-latest,cov: 'false', r: 'release'}
29-
- {os: windows-latest,cov: 'false', r: '3.6'}
30-
- {os: ubuntu-16.04, cov: 'false', r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
31-
- {os: ubuntu-16.04, cov: 'false', r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
32-
- {os: ubuntu-16.04, cov: 'false', r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
33-
- {os: ubuntu-16.04, cov: 'false', r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
34-
- {os: ubuntu-16.04, cov: 'false', r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
23+
- {os: macos-latest, r: 'release'}
24+
- {os: windows-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
- {os: ubuntu-latest, r: 'oldrel-1'}
3528

3629
env:
37-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
38-
RSPM: ${{ matrix.config.rspm }}
3930
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
4032

4133
steps:
42-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
4337

44-
- uses: r-lib/actions/setup-r@master
38+
- uses: r-lib/actions/setup-r@v2
4539
with:
4640
r-version: ${{ matrix.config.r }}
4741
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
4843

49-
- uses: r-lib/actions/setup-pandoc@master
50-
51-
- name: Query dependencies
52-
run: |
53-
install.packages('remotes')
54-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
55-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
56-
shell: Rscript {0}
57-
58-
- name: Cache R packages
59-
if: runner.os != 'Windows'
60-
uses: actions/cache@v1
44+
- uses: r-lib/actions/setup-r-dependencies@v2
6145
with:
62-
path: ${{ env.R_LIBS_USER }}
63-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
64-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
65-
66-
- name: Install system dependencies
67-
if: runner.os == 'Linux'
68-
run: |
69-
while read -r cmd
70-
do
71-
eval sudo $cmd
72-
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")')
73-
74-
- name: Install dependencies
75-
run: |
76-
remotes::install_deps(dependencies = TRUE)
77-
remotes::install_cran("rcmdcheck")
78-
shell: Rscript {0}
79-
80-
- name: Session info
81-
run: |
82-
options(width = 100)
83-
pkgs <- installed.packages()[, "Package"]
84-
sessioninfo::session_info(pkgs, include_base = TRUE)
85-
shell: Rscript {0}
86-
87-
- name: Check
88-
env:
89-
_R_CHECK_CRAN_INCOMING_: false
90-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
91-
shell: Rscript {0}
92-
93-
- name: Show testthat output
94-
if: always()
95-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
96-
shell: bash
97-
98-
- name: Cover
99-
if: matrix.config.cov == 'true'
100-
run: covr::codecov()
101-
shell: Rscript {0}
46+
extra-packages: any::rcmdcheck
47+
needs: check
10248

103-
- name: Upload check results
104-
if: failure()
105-
uses: actions/upload-artifact@main
49+
- uses: r-lib/actions/check-r-package@v2
10650
with:
107-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
108-
path: check
51+
upload-snapshots: true
52+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches: master
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
411

5-
name: pkgdown
12+
name: pkgdown.yaml
13+
14+
permissions: read-all
615

716
jobs:
817
pkgdown:
9-
runs-on: macOS-latest
18+
runs-on: ubuntu-latest
19+
# Only restrict concurrency for non-PR jobs
20+
concurrency:
21+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1022
env:
1123
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
permissions:
25+
contents: write
1226
steps:
13-
- uses: actions/checkout@v2
14-
15-
- uses: r-lib/actions/setup-r@master
27+
- uses: actions/checkout@v4
1628

17-
- uses: r-lib/actions/setup-pandoc@master
29+
- uses: r-lib/actions/setup-pandoc@v2
1830

19-
- name: Query dependencies
20-
run: |
21-
install.packages('remotes')
22-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
23-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
24-
shell: Rscript {0}
31+
- uses: r-lib/actions/setup-r@v2
32+
with:
33+
use-public-rspm: true
2534

26-
- name: Cache R packages
27-
uses: actions/cache@v1
35+
- uses: r-lib/actions/setup-r-dependencies@v2
2836
with:
29-
path: ${{ env.R_LIBS_USER }}
30-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
31-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
32-
33-
- name: Install dependencies
34-
run: |
35-
remotes::install_deps(dependencies = TRUE)
36-
install.packages("pkgdown")
37-
shell: Rscript {0}
37+
extra-packages: any::pkgdown, local::.
38+
needs: website
3839

39-
- name: Install package
40-
run: R CMD INSTALL .
40+
- name: Build site
41+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
42+
shell: Rscript {0}
4143

42-
- name: Deploy package
43-
run: |
44-
git config --local user.email "[email protected]"
45-
git config --local user.name "GitHub Actions"
46-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
44+
- name: Deploy to GitHub pages 🚀
45+
if: github.event_name != 'pull_request'
46+
uses: JamesIves/[email protected]
47+
with:
48+
clean: false
49+
branch: gh-pages
50+
folder: docs
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
use-public-rspm: true
25+
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr, any::xml2
29+
needs: coverage
30+
31+
- name: Test coverage
32+
run: |
33+
cov <- covr::package_coverage(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
38+
print(cov)
39+
covr::to_cobertura(cov)
40+
shell: Rscript {0}
41+
42+
- uses: codecov/codecov-action@v5
43+
with:
44+
# Fail if error if not on PR, or if on PR and token is given
45+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
46+
files: ./cobertura.xml
47+
plugins: noop
48+
disable_search: true
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
51+
- name: Show testthat output
52+
if: always()
53+
run: |
54+
## --------------------------------------------------------------------
55+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
56+
shell: bash
57+
58+
- name: Upload test results
59+
if: failure()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: coverage-test-failures
63+
path: ${{ runner.temp }}/package

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ Authors@R: c(
1717
role = "aut"),
1818
person(given = "Kate",
1919
family = "Doyle",
20-
role = "ctb"))
20+
role = "ctb"),
21+
person("Applied Epi Incorporated",
22+
role = "cph"),
23+
person("Medecins Sans Frontieres Operational Centre Amsterdam",
24+
role = "fnd"))
2125
Description: Produces tables for descriptive epidemiological analysis. These
2226
tables include attack rates, case fatality ratios and mortality rates
2327
(with appropriate confidence intervals), with additional functionality to
@@ -50,8 +54,4 @@ Suggests:
5054
cardx,
5155
testthat,
5256
matchmaker (>= 0.1.0),
53-
epidict,
5457
covr
55-
Remotes:
56-
R4EPI/epidict,
57-
R4EPI/epikit

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ Also add information on how to contact you by electronic and paper mail.
573573
If the program does terminal interaction, make it output a short notice like this
574574
when it starts in an interactive mode:
575575

576-
epitabulate Copyright (C) 2020 epitabulate
576+
epitabulate Copyright (C) 2020 Applied Epi Incorporated
577577
This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
578578
This is free software, and you are welcome to redistribute it
579579
under certain conditions; type 'show c' for details.

README.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ knitr::opts_chunk$set(
1717
<!-- badges: start -->
1818
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
1919
[![CRAN status](https://www.r-pkg.org/badges/version/epitabulate)](https://CRAN.R-project.org/package=epitabulate)
20-
[![Codecov test coverage](https://codecov.io/gh/R4EPI/epitabulate/branch/master/graph/badge.svg)](https://codecov.io/gh/R4EPI/epitabulate?branch=master)
21-
[![R build status](https://github.com/R4EPI/epitabulate/workflows/R-CMD-check/badge.svg)](https://github.com/R4EPI/epitabulate/actions)
20+
[![R-CMD-check](https://github.com/R4EPI/epitabulate/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/R4EPI/epitabulate/actions/workflows/R-CMD-check.yaml)
21+
[![Codecov test coverage](https://codecov.io/gh/R4EPI/epitabulate/graph/badge.svg)](https://app.codecov.io/gh/R4EPI/epitabulate)
2222
<!-- badges: end -->
2323

2424
```{r intro-hunk, child = 'man/rmdhunks/intro.Rmd'}

0 commit comments

Comments
 (0)