Skip to content

Commit e268897

Browse files
Initial commit
0 parents  commit e268897

35 files changed

+858
-0
lines changed

.Rbuildignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
^.*\.Rproj$
2+
^CITATION\.cff$
3+
^LICENSE\.md$
4+
^Meta$
5+
^README\.Rmd$
6+
^\.Rproj\.user$
7+
^\.github$
8+
^\.lintr$
9+
^\.pre-commit-config\.yaml$
10+
^_pkgdown\.yml$
11+
^codecov\.yml$
12+
^doc$
13+
^docs$
14+
^pkgdown$
15+
^tools$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "github-actions" # See documentation for possible values
7+
directory: "/" # Location of package manifests
8+
schedule:
9+
interval: "weekly"

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: R-CMD-check
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions: read-all
16+
17+
jobs:
18+
R-CMD-check:
19+
runs-on: ${{ matrix.config.os }}
20+
21+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
config:
27+
- {os: macos-latest, r: 'release'}
28+
- {os: windows-latest, r: 'release'}
29+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
30+
- {os: ubuntu-latest, r: 'release'}
31+
- {os: ubuntu-latest, r: 'oldrel-1'}
32+
33+
env:
34+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
35+
R_KEEP_PKG_SOURCE: yes
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- uses: r-lib/actions/setup-pandoc@v2
41+
42+
- uses: r-lib/actions/setup-r@v2
43+
with:
44+
r-version: ${{ matrix.config.r }}
45+
http-user-agent: ${{ matrix.config.http-user-agent }}
46+
use-public-rspm: true
47+
48+
- uses: r-lib/actions/setup-r-dependencies@v2
49+
with:
50+
extra-packages: any::rcmdcheck
51+
needs: check
52+
53+
- uses: r-lib/actions/check-r-package@v2
54+
with:
55+
upload-snapshots: true
56+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
57+
error-on: '"note"'
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
workflow_dispatch:
5+
pull_request:
6+
branches: [main, master]
7+
paths:
8+
- '**.R'
9+
- '**.Rmd'
10+
- '**/.lintr'
11+
- '**/.lintr.R'
12+
13+
name: lint-changed-files
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
lint-changed-files:
21+
runs-on: ubuntu-latest
22+
env:
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
30+
31+
- uses: r-lib/actions/setup-r-dependencies@v2
32+
with:
33+
extra-packages: |
34+
any::gh
35+
any::lintr
36+
any::purrr
37+
any::cyclocomp
38+
epiverse-trace/etdev
39+
needs: check
40+
41+
- name: Install package
42+
run: R CMD INSTALL .
43+
44+
- name: Extract and lint files changed by this PR
45+
run: |
46+
files <- gh::gh("/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files")
47+
changed_files <- purrr::map_chr(files, "filename")
48+
all_files <- list.files(recursive = TRUE)
49+
exclusions_list <- as.list(setdiff(all_files, changed_files))
50+
lintr::lint_package(exclusions = exclusions_list)
51+
shell: Rscript {0}
52+
env:
53+
LINTR_ERROR_ON_LINT: true

.github/workflows/pkgdown.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
#
4+
# Reproduce locally by running:
5+
# ```r
6+
# pak::pak(c("any::pkgdown", "."), dependencies = "Config/Needs/website")
7+
# pkgdown::build_site()
8+
# ```
9+
on:
10+
push:
11+
branches: [main, master]
12+
paths:
13+
- 'README.Rmd'
14+
- 'README.md'
15+
- 'index.Rmd'
16+
- 'index.md'
17+
- 'man/**'
18+
- 'vignettes/**'
19+
- '_pkgdown.yml'
20+
- 'pkgdown/**'
21+
- 'DESCRIPTION'
22+
- '.Rbuildignore'
23+
- '.github/**'
24+
merge_group:
25+
pull_request:
26+
paths:
27+
- 'README.Rmd'
28+
- 'README.md'
29+
- 'index.Rmd'
30+
- 'index.md'
31+
- 'man/**'
32+
- 'vignettes/**'
33+
- '_pkgdown.yml'
34+
- 'pkgdown/**'
35+
- 'DESCRIPTION'
36+
- '.Rbuildignore'
37+
- '.github/**'
38+
release:
39+
types: [published]
40+
workflow_dispatch:
41+
42+
name: pkgdown
43+
44+
concurrency:
45+
group: ${{ github.workflow }}-${{ github.ref }}
46+
cancel-in-progress: true
47+
48+
permissions:
49+
contents: write
50+
51+
jobs:
52+
pkgdown:
53+
runs-on: ubuntu-latest
54+
env:
55+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- uses: r-lib/actions/setup-pandoc@v2
60+
61+
- uses: r-lib/actions/setup-r@v2
62+
with:
63+
use-public-rspm: true
64+
65+
- uses: r-lib/actions/setup-r-dependencies@v2
66+
with:
67+
extra-packages: any::pkgdown, local::.
68+
needs: website
69+
70+
- name: Build site
71+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
72+
shell: Rscript {0}
73+
74+
- name: Check website links
75+
uses: untitaker/hyperlink@0.1.44
76+
with:
77+
args: docs/
78+
79+
- name: Deploy to GitHub pages 🚀
80+
if: github.event_name != 'merge_group' && github.event_name != 'pull_request'
81+
uses: JamesIves/github-pages-deploy-action@v4.7.3
82+
with:
83+
# We clean on releases because we want to remove old vignettes,
84+
# figures, etc. that have been deleted from the `main` branch.
85+
# But we clean ONLY on releases because we want to be able to keep
86+
# both the 'stable' and 'dev' websites.
87+
# Also discussed in https://github.com/r-lib/actions/issues/484
88+
clean: ${{ github.event_name == 'release' }}
89+
branch: gh-pages
90+
folder: docs
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
8+
name: test-coverage.yaml
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions: read-all
15+
16+
jobs:
17+
test-coverage:
18+
runs-on: ubuntu-latest
19+
env:
20+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: r-lib/actions/setup-r@v2
26+
with:
27+
use-public-rspm: true
28+
29+
- uses: r-lib/actions/setup-r-dependencies@v2
30+
with:
31+
extra-packages: any::covr, any::xml2
32+
needs: coverage
33+
34+
- name: Test coverage
35+
run: |
36+
cov <- covr::package_coverage(
37+
quiet = FALSE,
38+
clean = FALSE,
39+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
40+
)
41+
covr::to_cobertura(cov)
42+
shell: Rscript {0}
43+
44+
- uses: codecov/codecov-action@v4
45+
with:
46+
# Fail if error if not on PR, or if on PR and token is given
47+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
48+
file: ./cobertura.xml
49+
plugin: noop
50+
disable_search: true
51+
token: ${{ secrets.CODECOV_TOKEN }}
52+
53+
- name: Show testthat output
54+
if: always()
55+
run: |
56+
## --------------------------------------------------------------------
57+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
58+
shell: bash
59+
60+
- name: Upload test results
61+
if: failure()
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: coverage-test-failures
65+
path: ${{ runner.temp }}/package
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# The action runs when:
3+
# - The DESCRIPTION or inst/CITATION are modified
4+
# - Can be run manually
5+
# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- DESCRIPTION
12+
- inst/CITATION
13+
- .github/workflows/update-citation-cff.yaml
14+
workflow_dispatch:
15+
16+
name: Update CITATION.cff
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
21+
jobs:
22+
update-citation-cff:
23+
runs-on: ubuntu-latest
24+
env:
25+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: r-lib/actions/setup-r@v2
29+
- uses: r-lib/actions/setup-r-dependencies@v2
30+
with:
31+
extra-packages: |
32+
any::cffr
33+
any::V8
34+
35+
- name: Update CITATION.cff
36+
run: |
37+
38+
library(cffr)
39+
40+
# Customize with your own code
41+
# See https://docs.ropensci.org/cffr/articles/cffr.html
42+
43+
# Write your own keys
44+
mykeys <- list()
45+
46+
# Create your CITATION.cff file
47+
cff_write(keys = mykeys)
48+
49+
shell: Rscript {0}
50+
- name: Create Pull Request
51+
uses: peter-evans/create-pull-request@v7
52+
with:
53+
commit-message: Update `CITATION.cff`
54+
title: Update `CITATION.cff`
55+
body: |
56+
This pull request updates the citation file, ensuring all authors are credited and there are no discrepancies.
57+
58+
Please verify the changes before merging.
59+
branch: update-citation-cff

0 commit comments

Comments
 (0)