generated from vimc/vimc.rpkg.template
-
Notifications
You must be signed in to change notification settings - Fork 0
Initial package infrastructure #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
51f26bb
Update R, tests, man and vignettes
pratikunterwegs fb858e4
Add additional GH workflows
pratikunterwegs 1e9ed30
Update pkg infra for init rename
pratikunterwegs cb42068
Automatic readme update
actions-user 5fa62ba
Add suggestions from review
pratikunterwegs 269a495
Automatic readme update
actions-user File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,4 @@ | |
| ^docs$ | ||
| ^pkgdown$ | ||
| ^tools$ | ||
| ^scratch\.R$ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
| # Adapted from Epiverse packages: https://github.com/epiverse-trace | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'DESCRIPTION' | ||
|
|
||
| name: Analyze dependency changes | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| dependency-changes: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Setup R | ||
| uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| use-public-rspm: true | ||
|
|
||
| - name: Install dependencies | ||
| uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| packages: any::pak, glue, gh | ||
|
|
||
| - name: Analyze dependency changes | ||
| shell: Rscript {0} | ||
| run: | | ||
| deps_base <- pak::pkg_deps("${{ github.repository }}@${{ github.base_ref }}", dependencies = TRUE) |> | ||
| subset(!directpkg) |> | ||
| subset(is.na(priority)) | ||
| # We install from PR number rather than branch to deal with the case | ||
| # of PR coming from forks | ||
| deps_head <- pak::pkg_deps("${{ github.repository }}#${{ github.event.number }}", dependencies = TRUE) |> | ||
| subset(!directpkg) |> | ||
| subset(is.na(priority)) | ||
|
|
||
| deps_added <- deps_head |> | ||
| subset(!ref %in% deps_base$ref) | ||
|
|
||
| deps_removed <- deps_base |> | ||
| subset(!ref %in% deps_head$ref) | ||
|
|
||
| if (nrow(deps_added) + nrow(deps_removed) > 0) { | ||
|
|
||
| message("Dependencies have changed! Analyzing...") | ||
|
|
||
| if (nrow(deps_added) > 0) { | ||
| nudge <- "Reach out on slack (`#code-review` or `#help` channels) to double check if there are base R alternatives to the new dependencies.\n" | ||
| } else { | ||
| nudge <- "" | ||
| } | ||
|
|
||
| msg <- glue::glue( | ||
| .sep = "\n", | ||
| "This pull request:", | ||
| "- Adds {nrow(deps_added)} new dependencies (direct and indirect)", | ||
| "- Adds {length(unique(deps_added$sysreqs))} new system dependencies", | ||
| "- Removes {nrow(deps_removed)} existing dependencies (direct and indirect)", | ||
| "- Removes {length(unique(deps_removed$sysreqs))} existing system dependencies", | ||
| "", | ||
| nudge, | ||
| "(Note that results may be inaccurate if you branched from an outdated version of the target branch.)" | ||
| ) | ||
|
|
||
| message("Posting results as a pull request comment.") | ||
|
|
||
| gh::gh( | ||
| "POST /repos/{repo}/issues/{issue_number}/comments", | ||
| repo = "${{ github.repository }}", | ||
| issue_number = "${{ github.event.number }}", | ||
| body = msg | ||
| ) | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Adapted from Epiverse packages: https://github.com/epiverse-trace | ||
| # Reproduce locally by running: | ||
| # ```r | ||
| # pak::pak(c("any::rmarkdown", "any::usethis", ".")) | ||
| # writeLines( | ||
| # knitr::knit_expand( | ||
| # "README.Rmd", | ||
| # packagename = read.dcf("DESCRIPTION", "Package"), | ||
| # gh_repo = usethis:::github_remote_list()$repo_spec | ||
| # ), | ||
| # "README_expanded.Rmd" | ||
| # ) | ||
| # rmarkdown::render( | ||
| # "README_expanded.Rmd", | ||
| # output_file = "README.md", | ||
| # output_dir = "." | ||
| # ) | ||
| # unlink("README_expanded.Rmd") | ||
| # ``` | ||
| name: render-readme | ||
|
|
||
| # Controls when the action will run. Triggers include: | ||
| # | ||
| # - button trigger from github action page | ||
| # - on changes to readme.Rmd | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| # This may seem like a no-op but it prevents triggering on tags | ||
| # We use '**' rather '*' to accomodate names like 'dev/branch-1' | ||
| - '**' | ||
| paths: | ||
| - 'README.Rmd' | ||
| - '.github/workflows/render_readme.yml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
| jobs: | ||
| render-readme: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Checkout repos | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup R | ||
| uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| use-public-rspm: true | ||
|
|
||
| - name: Setup pandoc | ||
| uses: r-lib/actions/setup-pandoc@v2 | ||
|
|
||
| - name: Install dependencies | ||
| uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| extra-packages: any::rmarkdown, local::. | ||
|
|
||
| - name: Compile the readme | ||
| run: | | ||
| writeLines( | ||
| knitr::knit_expand( | ||
| "README.Rmd", | ||
| packagename = read.dcf("DESCRIPTION", "Package"), | ||
| gh_repo = Sys.getenv("GITHUB_REPOSITORY") | ||
| ), | ||
| "README_expanded.Rmd" | ||
| ) | ||
| rmarkdown::render( | ||
| "README_expanded.Rmd", | ||
| output_file = "README.md", | ||
| output_dir = "." | ||
| ) | ||
| shell: Rscript {0} | ||
|
|
||
| - name: Commit files | ||
| run: | | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "GitHub Action" | ||
| git add README.md | ||
| # Also add README figures if they exist | ||
| if [ -d man/figures ] | ||
| then | ||
| git add man/figures/ | ||
| fi | ||
| git diff-index --quiet HEAD || git commit -m "Automatic readme update" | ||
| git pull --rebase origin ${{ github.ref.name }} | ||
| git push origin || echo "No changes to push" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Adapted from Epiverse packages: https://github.com/epiverse-trace | ||
| name: Update copyright year(s) in license file | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 3 1 1 *' | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| run: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: FantasticFiasco/action-update-license-year@v3 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| path: | | ||
| LICENSE.md | ||
| prBody: > | ||
| This PR updates the copyright license for this new year! If you're reading this while you're celebrating, enjoy! Don't worry about this one :blush: | ||
|
|
||
|  | ||
| - uses: FantasticFiasco/action-update-license-year@v3 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| path: | | ||
| LICENSE | ||
| prBody: > | ||
| This PR updates the copyright license for this new year! If you're reading this while you're celebrating, enjoy! Don't worry about this one :blush: | ||
|
|
||
|  | ||
| transform: (?<=YEAR:\s)(?<from>\d{4})?-?(\d{4})? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,3 +49,4 @@ po/*~ | |
| rsconnect/ | ||
| inst/doc | ||
| docs | ||
| scratch.R | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,23 @@ | ||
| Package: vimc.rpkg.template | ||
| Title: Your Package Title in Title Case | ||
| Package: vimcheck | ||
| Title: Diagnostics for Vaccination Modelling Burden and Impact Estimates | ||
| Version: 0.0.0.9000 | ||
pratikunterwegs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Authors@R: c( | ||
| person("Pratik", "Gupte", , "[email protected]", role = c("aut", "cre"), | ||
| comment = c(ORCID = "0000-0001-5294-7819")), | ||
| person("Katy", "Gaythorpe", role = "aut", | ||
| comment = c(ORCID = "0000-0003-3734-9081")), | ||
| person("Xiang", "Li", role = "aut", | ||
| comment = c(ORCID = "0000-0002-5945-159X")), | ||
| person("Zoe", "Gibney", role = "aut"), | ||
pratikunterwegs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| person("Imperial College of Science, Technology and Medicine", role = c("cph", "fnd")) | ||
| ) | ||
| Description: Your package description. It must end with a period (".") and | ||
| include relevant bibliographical references if applicable, using the | ||
| following format: Author et al. (2023) <doi:10.5281/zenodo.6619350>. | ||
| Description: Run diagnostics on burden estimates submitted to the Vaccine | ||
| Impact Modelling Consortium (VIMC), and impacts estimated by VIMC, as | ||
pratikunterwegs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| described in Echeverria-Londono et al. (2021) | ||
pratikunterwegs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <doi:10.1186/s12889-021-12040-9>. | ||
| License: MIT + file LICENSE | ||
| URL: https://github.com/vimc/vimcheck, https://vimc.github.io/vimcheck/ | ||
| BugReports: https://github.com/vimc/vimcheck/issues | ||
| Suggests: | ||
| knitr, | ||
| rmarkdown, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| # Generated by roxygen2: do not edit by hand | ||
|
|
||
| export(get_manual_mean) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # vimc.rpkg.template 0.0.1 | ||
| # vimcheck 0.0.1 | ||
|
|
||
| * This project now includes a | ||
| [`NEWS.md`](https://r-pkgs.org/other-markdown.html#sec-news) file to inform | ||
| users about changes and new features. | ||
| - Added GHA workflows to notify of changed dependencies, auto-render `README.md` from `README.Rmd`, and update the copyright year annually. | ||
|
|
||
| - Added reference to VIMC paper (Echeverria-Londono et al. 2021). |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.