From 8ac0a523c6cfbe739950295ba26c554fa1eff5a3 Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 08:47:25 +0100 Subject: [PATCH 1/8] Adding github actions via usethis --- .github/workflows/R-CMD-check.yaml | 51 ++++++++++++++++++++++++++++++ README.md | 4 +++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/R-CMD-check.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..562fe0f --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,51 @@ +# 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: + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/README.md b/README.md index 8045d58..5a11e82 100644 --- a/README.md +++ b/README.md @@ -125,3 +125,7 @@ plot(sumPartByGeneration) - References on the theoretical and applied work in this domain are briefly summarised in [References](vignettes/references.Rmd). + + +[![R-CMD-check](https://github.com/AlphaGenes/AlphaPart/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AlphaGenes/AlphaPart/actions/workflows/R-CMD-check.yaml) + From 53b0228f782c7e10a5fbd2ec98572a174dcd6a52 Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 09:23:04 +0100 Subject: [PATCH 2/8] Removing old cmd check --- .github/workflows/check-r-package.yaml | 76 -------------------------- 1 file changed, 76 deletions(-) delete mode 100644 .github/workflows/check-r-package.yaml diff --git a/.github/workflows/check-r-package.yaml b/.github/workflows/check-r-package.yaml deleted file mode 100644 index ee35d60..0000000 --- a/.github/workflows/check-r-package.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: 'check-r-package' -description: 'Action to check R package with rcmdcheck. Assumes that rcmdcheck has already been installed.' -author: 'Jim Hester' -inputs: - args: - description: 'Arguments to pass to the `args` parameter of rcmdcheck. Must be an R expression. Note that it often needs to be quoted in YAML, see the README for details.' - default: 'c("--no-manual", "--as-cran")' - build_args: - description: 'Arguments to pass to the `build_args` parameter of rcmdcheck. Note that it often needs to be quoted in YAML, see the README for details.' - default: '"--no-manual"' - error-on: - description: 'What type of result should cause a build error? Note that it often needs to be quoted in YAML, see the README for details.' - default: '"warning"' - check-dir: - description: 'Where should the check output go? Note that it often needs to be quoted in YAML, see the README for details.' - default: '"check"' - working-directory: - description: 'Using the working-directory keyword, you can specify the working directory of where "rcmdcheck::rcmdcheck" is run.' - default: '.' - upload-snapshots: - description: | - Whether to upload all testthat snapshots as an artifact. Possible values are 'true', - 'false', 'always'. - default: false - upload-results: - description: | - Whether to upload check results for successful runs too. If 'never', - then it does not upload the results, even on failure. - default: false - artifact-name: - description: | - Use this to override the default artifact name for the check results. - snapshot-artifact-name: - description: | - Use this to override the default artifact name for testthat snapshots. - -runs: - using: "composite" - steps: - - name: Check - id: rcmdcheck - run: | - ## -------------------------------------------------------------------- - options(crayon.enabled = TRUE) - cat("LOGNAME=", Sys.info()[["user"]], "\n", sep = "", file = Sys.getenv("GITHUB_ENV"), append = TRUE) - if (Sys.getenv("_R_CHECK_FORCE_SUGGESTS_", "") == "") Sys.setenv("_R_CHECK_FORCE_SUGGESTS_" = "false") - if (Sys.getenv("_R_CHECK_CRAN_INCOMING_", "") == "") Sys.setenv("_R_CHECK_CRAN_INCOMING_" = "false") - cat("check-dir-path=", file.path(getwd(), (${{ inputs.check-dir }})), "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) - check_results <- rcmdcheck::rcmdcheck(args = (${{ inputs.args }}), build_args = (${{ inputs.build_args }}), error_on = (${{ inputs.error-on }}), check_dir = (${{ inputs.check-dir }})) - shell: Rscript {0} - working-directory: ${{ inputs.working-directory }} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - echo ::group::Show testthat output - find check -name 'testthat.Rout*' -exec cat '{}' \; || true - echo ::endgroup:: - shell: bash - working-directory: ${{ inputs.working-directory }} - - - name: Upload check results - if: ${{ (failure() && inputs.upload-results != 'never') || (inputs.upload-results != 'false' && inputs.upload-results != 'never') }} - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.artifact-name || format('{0}-{1}-r{2}-{3}-results', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }} - path: ${{ steps.rcmdcheck.outputs.check-dir-path }} - - - name: Upload snapshots - if: ${{ (failure() && inputs.upload-snapshots == 'always') || inputs.upload-snapshots != 'false' }} - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.snapshot-artifact-name || format('{0}-{1}-r{2}-{3}-testthat-snapshots', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }} - path: ${{ steps.rcmdcheck.outputs.check-dir-path }}/**/tests*/testthat/_snaps - if-no-files-found: ignore From 45f6e31bbf16a9be8e1affdee8d132529122234c Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 09:24:47 +0100 Subject: [PATCH 3/8] Adding devel to github actions --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 562fe0f..20649af 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master] + branches: [main, master, devel] pull_request: name: R-CMD-check.yaml From f1db9fd1f661258759bcf7aa05e2e79dee5f36e6 Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 09:27:11 +0100 Subject: [PATCH 4/8] Update jana fork R-CMD-check badge link in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a11e82..7ebad74 100644 --- a/README.md +++ b/README.md @@ -127,5 +127,5 @@ plot(sumPartByGeneration) briefly summarised in [References](vignettes/references.Rmd). -[![R-CMD-check](https://github.com/AlphaGenes/AlphaPart/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AlphaGenes/AlphaPart/actions/workflows/R-CMD-check.yaml) - + [![R-CMD-check](https://github.com/janaobsteter/AlphaPart_package/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/janaobsteter/AlphaPart_package/actions/workflows/R-CMD-check.yaml) + From b1b3005a1431f94e73901035a57e89ce70e23cc1 Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 13:28:53 +0100 Subject: [PATCH 5/8] Preparing the R-CMD-badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a11e82..ff7aaec 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ | Package | Status | Coverage | GitHub | Miscellaneous | |----|----|----|----|----| | [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/AlphaPart)](https://cran.r-project.org/package=AlphaPart) | [![Development](https://img.shields.io/badge/development-active-blue.svg)](https://img.shields.io/badge/development-active-blue.svg) | [![codecov](https://codecov.io/gh/AlphaGenes/AlphaPart/branch/version-0.8.2/graph/badge.svg?token=WS7YGNSOVL)](https://codecov.io/gh/AlphaGenes/AlphaPart) | [![GitHub version](https://img.shields.io/badge/GitHub-0.6.8.9000-orange.svg?style=flat-square)](https://github.com/AlphaGenes/AlphaPart/) | [![downloads](https://cranlogs.r-pkg.org/badges/AlphaPart)](https://cranlogs.r-pkg.org/badges/AlphaPart) | -| [![CRAN Checks](https://cranchecks.info/badges/summary/AlphaPart)](https://cran.r-project.org/web/checks/check_results_AlphaPart.html) | [![R build status](https://github.com/AlphaGenes/AlphaPart/workflows/R-CMD-check/badge.svg)](https://github.com/AlphaGenes/AlphaPart/) | [![lints](https://github.com//AlphaGenes/AlphaPart/workflows/lint/badge.svg)](https://github.com/AlphaGenes/AlphaPart/) | [![Forks](https://img.shields.io/badge/forks-NA-blue.svg)](https://github.com/AlphaGenes/AlphaPart/) | [![total downloads](https://cranlogs.r-pkg.org/badges/grand-total/AlphaPart)](https://cranlogs.r-pkg.org/badges/grand-total/AlphaPart) | +| [![CRAN Checks](https://cranchecks.info/badges/summary/AlphaPart)](https://cran.r-project.org/web/checks/check_results_AlphaPart.html) | [![R-CMD-check](https://github.com/AlphaGenes/AlphaPart/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AlphaGenes/AlphaPart/actions/workflows/R-CMD-check.yaml) | [![lints](https://github.com//AlphaGenes/AlphaPart/workflows/lint/badge.svg)](https://github.com/AlphaGenes/AlphaPart/) | [![Forks](https://img.shields.io/badge/forks-NA-blue.svg)](https://github.com/AlphaGenes/AlphaPart/) | [![total downloads](https://cranlogs.r-pkg.org/badges/grand-total/AlphaPart)](https://cranlogs.r-pkg.org/badges/grand-total/AlphaPart) | | [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg)](https://cran.r-project.org/) | [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/9gjgy9ff2i15fa4q?svg=true)](https://ci.appveyor.com/project/Prof-ThiagoOliveira/alphapart) | **Code Factor** | [![Github Issues](https://img.shields.io/badge/issues-NA-red.svg)](https://github.com/AlphaGenes/AlphaPart/issues) | [![Licence](https://img.shields.io/badge/licence-MIT-blue.svg)](https://opensource.org/licenses/MIT) | | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html) | | [![CodeFactor](https://www.codefactor.io/repository/github/alphagenes/alphapart/badge)](https://www.codefactor.io/repository/github/alphagenes/alphapart) | [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/AlphaGenes/AlphaPart.svg)](https://github.com/AlphaGenes/AlphaPart/) | | From 04f196e6fc57f78d7350200fc138ceeabe456422 Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 13:32:45 +0100 Subject: [PATCH 6/8] Removing the end badge from readme --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index aac0e8d..3abf6a6 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,4 @@ plot(sumPartByGeneration) - References on the theoretical and applied work in this domain are briefly summarised in [References](vignettes/references.Rmd). - - - [![R-CMD-check](https://github.com/janaobsteter/AlphaPart_package/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/janaobsteter/AlphaPart_package/actions/workflows/R-CMD-check.yaml) - + \ No newline at end of file From 611439e785f9b5c271e5c140d80558f8b1d078a7 Mon Sep 17 00:00:00 2001 From: janaobsteter Date: Tue, 28 Oct 2025 13:32:45 +0100 Subject: [PATCH 7/8] Removing the end badge from readme --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index aac0e8d..cc4d905 100644 --- a/README.md +++ b/README.md @@ -124,8 +124,4 @@ plot(sumPartByGeneration) `vignette("ibd", package = "AlphaPart")` - References on the theoretical and applied work in this domain are - briefly summarised in [References](vignettes/references.Rmd). - - - [![R-CMD-check](https://github.com/janaobsteter/AlphaPart_package/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/janaobsteter/AlphaPart_package/actions/workflows/R-CMD-check.yaml) - + briefly summarised in [References](vignettes/references.Rmd). \ No newline at end of file From 0f20b4f062dcde54eb78ec662d7f5e651b97dd74 Mon Sep 17 00:00:00 2001 From: Gregor Gorjanc Date: Thu, 30 Oct 2025 17:14:05 +0000 Subject: [PATCH 8/8] Apply suggestion from @gregorgorjanc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f39ef9d..2308c8b 100644 --- a/README.md +++ b/README.md @@ -124,4 +124,4 @@ plot(sumPartByGeneration) `vignette("ibd", package = "AlphaPart")` - References on the theoretical and applied work in this domain are -briefly summarised in [References](vignettes/references.Rmd). + briefly summarised in [References](vignettes/references.Rmd).