From 3d08d7857b046ff80de381694a9883b0470c031c Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Wed, 18 Dec 2024 09:57:39 +0000 Subject: [PATCH] refresh package; fix #23; fix #24; fix #25 --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 5 +++-- .github/workflows/pkgdown.yaml | 5 +++-- .github/workflows/test-coverage.yaml | 19 +++++++++++++++---- .gitignore | 5 +++++ DESCRIPTION | 2 +- README.Rmd | 8 ++++---- README.md | 12 ++++++------ pkgdown/_pkgdown.yml | 21 ++++++++------------- 9 files changed, 46 insertions(+), 32 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index af87913..720f217 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^appveyor\.yml$ ^codecov\.yml$ ^_pkgdown\.yml$ +^README\.html$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 14159b7..562fe0f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -4,9 +4,10 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index a7276e8..bfc9f4d 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -4,12 +4,13 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] release: types: [published] workflow_dispatch: -name: pkgdown +name: pkgdown.yaml + +permissions: read-all jobs: pkgdown: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 21b8a93..e050312 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -4,9 +4,10 @@ on: push: branches: [main, master] pull_request: - branches: [main, master] -name: test-coverage +name: test-coverage.yaml + +permissions: read-all jobs: test-coverage: @@ -23,18 +24,28 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr + extra-packages: any::covr, any::xml2 needs: coverage - name: Test coverage run: | - covr::codecov( + cov <- covr::package_coverage( quiet = FALSE, clean = FALSE, install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) + covr::to_cobertura(cov) shell: Rscript {0} + - uses: codecov/codecov-action@v4 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + - name: Show testthat output if: always() run: | diff --git a/.gitignore b/.gitignore index 234f028..f3a7ab9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,9 @@ .Rhistory .RData .Ruserdata + + docs +README.html + + diff --git a/DESCRIPTION b/DESCRIPTION index b05b1ef..7f7a566 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,7 +26,7 @@ Suggests: Encoding: UTF-8 Language: en-GB LazyData: true -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Roxygeon: list(markdown = TRUE) URL: https://rapidsurveys.io/okapi/,https://github.com/rapidsurveys/okapi BugReports: https://github.com/rapidsurveys/okapi/issues diff --git a/README.Rmd b/README.Rmd index d508656..fdf92b3 100644 --- a/README.Rmd +++ b/README.Rmd @@ -30,9 +30,9 @@ Data collection using computer-assisted personal interviewing or CAPI tools is n ## The ODK ecosystem -## What does `okapi` do? +## What does the package do? -Currently, `okapi` provides functions to interface with two ODK-based systems: [ONA](https://getodk.org) and [KoboToolbox](https://kobotoolbox.org) via their respective APIs. The current set of functions perform the following tasks: +Currently, `{okapi}` provides functions to interface with two ODK-based systems: [ONA](https://getodk.org) and [KoboToolbox](https://kobotoolbox.org) via their respective APIs. The current set of functions perform the following tasks: 1. Authenticate with the respective servers using either an account password or an API token; @@ -42,7 +42,7 @@ Currently, `okapi` provides functions to interface with two ODK-based systems: [ ## Installation -`okapi` is not yet available on [CRAN](https://cran.r-project.org). +`{okapi}` is not yet available on [CRAN](https://cran.r-project.org). You can install `okapi` from the [RapidSurveys R Universe](https://rapidsurveys.r-universe.dev) with: @@ -60,7 +60,7 @@ install.packages( ## Citation -If you find the `okapi` package useful, please cite using the suggested citation provided by a call to the `citation` function as follows: +If you use `{okapi}` in your work, please cite using the suggested citation provided by a call to the `citation` function as follows: ```{r cite} citation("okapi") diff --git a/README.md b/README.md index b817241..f348cae 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,9 @@ Data Kit or ODK](https://getodk.org) technology. ## The ODK ecosystem -## What does `okapi` do? +## What does the package do? -Currently, `okapi` provides functions to interface with two ODK-based +Currently, `{okapi}` provides functions to interface with two ODK-based systems: [ONA](https://getodk.org) and [KoboToolbox](https://kobotoolbox.org) via their respective APIs. The current set of functions perform the following tasks: @@ -45,7 +45,7 @@ current set of functions perform the following tasks: ## Installation -`okapi` is not yet available on [CRAN](https://cran.r-project.org). +`{okapi}` is not yet available on [CRAN](https://cran.r-project.org). You can install `okapi` from the [RapidSurveys R Universe](https://rapidsurveys.r-universe.dev) with: @@ -64,7 +64,7 @@ install.packages( ## Citation -If you find the `okapi` package useful, please cite using the suggested +If you use `{okapi}` in your work, please cite using the suggested citation provided by a call to the `citation` function as follows: ``` r @@ -72,8 +72,8 @@ citation("okapi") #> To cite okapi in publications use: #> #> Ernest Guevarra (2023). okapi: Open Data Kit (ODK)-based -#> Computer-assisted Personal Interview (CAPI) Tools R package version -#> 0.1.0.9000 URL https://rapidsurveys.io/okapi/ +#> Computer-assisted Personal Interview (CAPI) Tools R package +#> version 0.1.0.9000 URL https://rapidsurveys.io/okapi/ #> #> A BibTeX entry for LaTeX users is #> diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index ebe5a4e..8c67da4 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -5,12 +5,11 @@ url: https://rapidsurveys.io/okapi template: bootstrap: 5 bootswatch: united - theme: haddock - ganalytics: + theme: breeze-light + ganalytics: "G-VQQX28ZSBV" navbar: - bg: danger - type: light + bg: dark structure: left: [home, intro, reference, articles, news] right: [mastodon, linkedin, github] @@ -21,18 +20,14 @@ navbar: # menu: # - text: "Detecting haemoglobinaemia" # href: articles/haemoglobinaemia.html - # - text: "Detecting inflammation" - # href: articles/inflammation.html - # - text: "Detecting iron deficiency" - # href: articles/iron-deficiency.html - # - text: "Detecting iodine deficiency" - # href: articles/iodine-deficiency.html mastodon: icon: "fab fa-mastodon fa-lg" href: https://fosstodon.org/@katilingban + aria-label: Mastodon linkedin: icon: "fab fa-linkedin fa-lg" href: https://www.linkedin.com/company/katilingban + aria-label: LinkedIn home: links: @@ -61,15 +56,15 @@ reference: - title: ONA API - Forms contents: - - starts_with("ona_form") + - starts_with("ona_form") - title: ONA API - Projects contents: - - starts_with("ona_project") + - starts_with("ona_project") - title: ONA API - Organisations contents: - - starts_with("ona_org") + - starts_with("ona_org") - title: KoBo Toolbox API contents: