From 74b155dd3f3ff69539cd7e292807e45bb78e8ff6 Mon Sep 17 00:00:00 2001 From: Mauro Lepore Date: Thu, 30 May 2024 13:47:01 +0000 Subject: [PATCH] Add infrastructure --- .Rbuildignore | 5 +++ .github/.gitignore | 1 + .github/pull_request_template.md | 24 ++++++++++++ .github/workflows/call-R-CMD-check.yaml | 13 +++++++ .github/workflows/pkgdown.yaml | 50 +++++++++++++++++++++++++ .gitignore | 1 + DESCRIPTION | 12 ++++-- R/tiltTransitionRisk-package.R | 6 +++ README.Rmd | 37 ++++++++++++++++++ README.md | 26 +++++++++++++ _pkgdown.yml | 4 ++ man/tiltTransitionRisk-package.Rd | 20 ++++++++++ 12 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/call-R-CMD-check.yaml create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 R/tiltTransitionRisk-package.R create mode 100644 README.Rmd create mode 100644 README.md create mode 100644 _pkgdown.yml create mode 100644 man/tiltTransitionRisk-package.Rd diff --git a/.Rbuildignore b/.Rbuildignore index d0eadb7..9f34af4 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,8 @@ ^tiltTransitionRisk\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ +^README\.Rmd$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..7c1d4cc --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ + + +---- + +TODO + +- [ ] Draft the PR title. +- [ ] [Link related issue/PR]([url](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)). +- [ ] Draft the PR description. +- [ ] Mark the PR as draft. +- [ ] [Include a unit test](https://code-review.tidyverse.org/reviewer/aspects.html#sec-tests). +- [ ] Review your own PR in "Files changed". +- [ ] Ensure the PR branch is updated. +- [ ] Ensure all checks pass. +- [ ] Change the PR status from draft to ready. +- [ ] Polish the PR description to reflect it's goal (why not how). +- [ ] Polish the PR title as you'd like others to read it from the git log. +- [ ] Assign a reviewer. + +Also if the PR includes user-facing changes: + +- [ ] Increment the version number: `fledge::update_version()` +- [ ] Update the changelog: `fledge::update_news()` +- [ ] Merge then tag: `fledge::tag_version()` diff --git a/.github/workflows/call-R-CMD-check.yaml b/.github/workflows/call-R-CMD-check.yaml new file mode 100644 index 0000000..32a5c54 --- /dev/null +++ b/.github/workflows/call-R-CMD-check.yaml @@ -0,0 +1,13 @@ +# https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + call: + uses: 2DegreesInvesting/tiltDevTools/.github/workflows/R-CMD-check.yaml@main + secrets: inherit diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..c9f0165 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,50 @@ +# 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 +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 7c794aa..457525e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .httr-oauth .DS_Store .quarto +docs diff --git a/DESCRIPTION b/DESCRIPTION index e9c3611..eb669bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,17 @@ Package: tiltTransitionRisk -Title: What the Package Does (One Line, Title Case) +Title: Transition Risk Version: 0.0.0.9000 Authors@R: person("Mauro", "Lepore", , "maurolepore@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "https://orcid.org/0000-0002-1986-7988")) -Description: What the package does (one paragraph). +Description: Transition risk. License: GPL (>= 3) +URL: https://github.com/2DegreesInvesting/tiltTransitionRisk, + https://2degreesinvesting.github.io/tiltTransitionRisk/ +BugReports: https://github.com/2DegreesInvesting/tiltTransitionRisk/issues +Suggests: + testthat (>= 3.0.0) +Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 -URL: https://github.com/2DegreesInvesting/tiltTransitionRisk -BugReports: https://github.com/2DegreesInvesting/tiltTransitionRisk/issues diff --git a/R/tiltTransitionRisk-package.R b/R/tiltTransitionRisk-package.R new file mode 100644 index 0000000..a65cf64 --- /dev/null +++ b/R/tiltTransitionRisk-package.R @@ -0,0 +1,6 @@ +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..1fce131 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,37 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# tiltTransitionRisk + + + + +The goal of tiltTransitionRisk is to host code related specifically to the +transition score indicator. + +## Installation + +You can install the development version of tiltTransitionRisk from [GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("2DegreesInvesting/tiltTransitionRisk") +``` + +## Example + +```{r example} +library(tiltTransitionRisk) +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..59acb23 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ + + + +# tiltTransitionRisk + + + + +The goal of tiltTransitionRisk is to host code related specifically to +the transition score indicator. + +## Installation + +You can install the development version of tiltTransitionRisk from +[GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("2DegreesInvesting/tiltTransitionRisk") +``` + +## Example + +``` r +library(tiltTransitionRisk) +``` diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..da86dae --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: https://2degreesinvesting.github.io/tiltTransitionRisk/ +template: + bootstrap: 5 + diff --git a/man/tiltTransitionRisk-package.Rd b/man/tiltTransitionRisk-package.Rd new file mode 100644 index 0000000..fd9c296 --- /dev/null +++ b/man/tiltTransitionRisk-package.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tiltTransitionRisk-package.R +\docType{package} +\name{tiltTransitionRisk-package} +\alias{tiltTransitionRisk} +\alias{tiltTransitionRisk-package} +\title{tiltTransitionRisk: Transition Risk} +\description{ +Transition risk. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/2DegreesInvesting/tiltTransitionRisk} + \item \url{https://2degreesinvesting.github.io/tiltTransitionRisk/} + \item Report bugs at \url{https://github.com/2DegreesInvesting/tiltTransitionRisk/issues} +} + +} +\keyword{internal}