diff --git a/.github/workflows/mirror-codeberg.yaml b/.github/workflows/mirror-codeberg.yaml new file mode 100644 index 0000000..3f0095f --- /dev/null +++ b/.github/workflows/mirror-codeberg.yaml @@ -0,0 +1,19 @@ +name: Mirror to other git server +on: + push: + branches: + - main + tags: + - "*" +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: yesolutions/mirror-action@master + with: + REMOTE: https://codeberg.org/nutriverse/dietry + GIT_USERNAME: ${{ secrets.CODEBERG_USERNAME }} + GIT_PASSWORD: ${{ secrets.CODEBERG_TOKEN }} diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml new file mode 100644 index 0000000..10c6fe1 --- /dev/null +++ b/.github/workflows/netlify.yaml @@ -0,0 +1,53 @@ +on: + pull_request: + branches: [main, master] + +name: pkgdown-pr + +jobs: + netlify: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-tinytex@v2 + + - 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: Install package + run: R CMD INSTALL . + + - name: Create website + run: | + pkgdown::build_site() + shell: Rscript {0} + + - name: Create index file + run: | + echo '
' > ./docs/index.html + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v3.0 + with: + publish-dir: './docs' + production-branch: main + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: + 'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' + # these default to 'true' + enable-commit-comment: false + enable-github-deployment: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 1b644bc..0ab748d 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -14,7 +14,6 @@ jobs: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v4 @@ -35,15 +34,16 @@ jobs: clean = FALSE, install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) + print(cov) covr::to_cobertura(cov) shell: Rscript {0} - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 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 + files: ./cobertura.xml + plugins: noop disable_search: true token: ${{ secrets.CODECOV_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index b1d7d62..2d35041 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: dietry Type: Package Title: Utilities for Calculating Dietary Intake Indicators for Food Security Assessments -Version: 0.0.0.9000 +Version: 0.0.0.9001 Authors@R: person("Ernest", "Guevarra", comment = c(ORCID = "0000-0002-4887-4415"), email = "ernest@guevarra.io", role = c("aut", "cre")) @@ -22,7 +22,7 @@ Suggests: Encoding: UTF-8 Language: en-GB LazyData: true -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Roxygen: list(markdown = TRUE) URL: https://nutriverse.io/dietry/, https://github.com/nutriverse/dietry BugReports: https://github.com/nutriverse/dietry/issues diff --git a/README.Rmd b/README.Rmd index c7cd003..7893b26 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,24 +19,24 @@ knitr::opts_chunk$set( [](https://www.repostatus.org/#wip) [](https://lifecycle.r-lib.org/articles/stages.html#experimental) [](https://github.com/nutriverse/dietry/actions/workflows/R-CMD-check.yaml) -[](https://app.codecov.io/gh/nutriverse/dietry?branch=main) +[](https://app.codecov.io/gh/nutriverse/dietry) [](https://www.codefactor.io/repository/github/nutriverse/dietry) [](https://zenodo.org/badge/latestdoi/477273747) Food security assessments utilise several dietary intake indicators as proxy measures for diet quality, diet sufficiency, and food availability either at individual or household level. Utilities for recoding and calculating these indicators support in establishing consistent and reliable results. -## What does `dietry` do? +## What does the package do? -Currently, the `dietry` package has functions for: +Currently, the `{dietry}` package has functions for: * Cleaning, processing, scoring, and classifying the [Food Consumption Score](https://resources.vam.wfp.org/data-analysis/quantitative/food-security/food-consumption-score). ## Installation -The `dietry` package is still in active development and not yet available on [CRAN](https://cran.r-project.org/). +The `{dietry}` package is still in active development and not yet available on [CRAN](https://cran.r-project.org/). -You can install the development version of `dietry` from the [nutriverse R Universe](https://nutriverse.r-universe.dev) with: +You can install the development version of `{dietry}` from the [nutriverse R Universe](https://nutriverse.r-universe.dev) with: ``` r install.packages( @@ -47,7 +47,7 @@ install.packages( ## Citation -If you find the `dietry` package useful, please cite using the suggested citation provided by a call to the `citation` function as follows: +If you find the `{dietry}` package useful, please cite using the suggested citation provided by a call to the `citation` function as follows: ```{r cite} citation("dietry") @@ -59,3 +59,6 @@ Feedback, bug reports, and feature requests are welcome; file issues or seek sup This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. +