From b9d31490c8b6c515a0ad4f6123c71a79ed57cb34 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Tue, 6 Sep 2022 18:40:04 +0200 Subject: [PATCH] Use standardized GHA workflows (#473) * Use standardized GHA workflows https://github.com/easystats/easystats/issues/234 * Update README * Run example conditionally * Bump needed versions --- .github/workflows/R-CMD-check.yaml | 17 ++++++++ .github/workflows/R-check.yaml | 65 ---------------------------- .github/workflows/check-readme.yaml | 14 ++++++ .github/workflows/html-5-check.yaml | 13 ++++++ .github/workflows/lint.yaml | 44 +++---------------- .github/workflows/pkgdown.yaml | 36 +-------------- .github/workflows/render-readme.yaml | 30 ------------- .github/workflows/test-coverage.yaml | 20 +-------- DESCRIPTION | 8 ++-- R/convert_stat_to_anova.R | 2 +- README.Rmd | 2 +- README.md | 5 ++- man/F_to_eta2.Rd | 2 +- 13 files changed, 61 insertions(+), 197 deletions(-) create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/R-check.yaml create mode 100644 .github/workflows/check-readme.yaml create mode 100644 .github/workflows/html-5-check.yaml delete mode 100644 .github/workflows/render-readme.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 000000000..172129b91 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,17 @@ +# 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 +# +# NOTE: This workflow is overkill for most R packages and +# check-standard.yaml is likely a better choice. +# usethis::use_github_action("check-standard") will install it. +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + uses: easystats/workflows/.github/workflows/R-CMD-check.yaml@main diff --git a/.github/workflows/R-check.yaml b/.github/workflows/R-check.yaml deleted file mode 100644 index 88866fb50..000000000 --- a/.github/workflows/R-check.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# 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 -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. -# usethis::use_github_action("check-standard") will install it. -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -name: R-CMD-check - -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: 'devel'} - - {os: macOS-latest, r: 'release'} - - {os: macOS-latest, r: 'oldrel-1'} - - {os: macOS-latest, r: '4.0.0'} - - {os: macOS-latest, r: '3.6.0'} - - {os: macOS-latest, r: '3.5.0'} - - - {os: windows-latest, r: 'devel'} - - {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 - _R_CHECK_CRAN_INCOMING_: false - _R_CHECK_FORCE_SUGGESTS_: false - - steps: - - uses: actions/checkout@v2 - - - 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 - lme4=?ignore-before-r=3.6.0 - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - error-on: '"note"' \ No newline at end of file diff --git a/.github/workflows/check-readme.yaml b/.github/workflows/check-readme.yaml new file mode 100644 index 000000000..4479963be --- /dev/null +++ b/.github/workflows/check-readme.yaml @@ -0,0 +1,14 @@ +# 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] + +name: check-readme + +jobs: + check-readme: + uses: easystats/workflows/.github/workflows/check-readme.yaml@main diff --git a/.github/workflows/html-5-check.yaml b/.github/workflows/html-5-check.yaml new file mode 100644 index 000000000..1439a3228 --- /dev/null +++ b/.github/workflows/html-5-check.yaml @@ -0,0 +1,13 @@ +# 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] + +name: HTML5 check + +jobs: + HTML5-check: + uses: easystats/workflows/.github/workflows/html-5-check.yaml@main diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 835f3a426..dfc3638d2 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,47 +1,13 @@ +# 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 + branches: [main, master] pull_request: - branches: - - main + branches: [main, master] name: lint jobs: lint: - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@master - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("lintr") - shell: Rscript {0} - - - name: Install package - run: R CMD INSTALL . - - - name: Lint - run: lintr::lint_package() - shell: Rscript {0} + uses: easystats/workflows/.github/workflows/lint.yaml@main diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e0d0d7fc8..2f37092e1 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -13,38 +13,4 @@ name: pkgdown 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 }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-pandoc@v2 - with: - pandoc-version: '2.19.2' - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: | - local::. - r-lib/pkgdown - 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@4.1.4 - with: - clean: false - branch: gh-pages - folder: docs + uses: easystats/workflows/.github/workflows/pkgdown.yaml@main diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml deleted file mode 100644 index 4ad3b1032..000000000 --- a/.github/workflows/render-readme.yaml +++ /dev/null @@ -1,30 +0,0 @@ -on: - push: - branches: main - -name: Render README - -jobs: - render: - name: Render README - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-pandoc@v2 - - name: Install rmarkdown, remotes, and the local package - run: | - install.packages("remotes") - remotes::install_local(".") - remotes::install_cran("rmarkdown") - shell: Rscript {0} - - name: Render README - run: Rscript -e 'rmarkdown::render("README.Rmd")' - - name: Commit results - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit" - git push origin || echo "No changes to commit" diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 90f2ee0e0..c12b1d46c 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -10,22 +10,4 @@ name: test-coverage jobs: test-coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@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::covr - needs: coverage - - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} \ No newline at end of file + uses: easystats/workflows/.github/workflows/test-coverage.yaml@main diff --git a/DESCRIPTION b/DESCRIPTION index fa27a53e6..6938f3e94 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -57,10 +57,10 @@ Depends: R (>= 3.5) Imports: bayestestR (>= 0.12.1), - insight (>= 0.18.0), - parameters (>= 0.18.1), - performance (>= 0.9.1), - datawizard (>= 0.5.0), + insight (>= 0.18.2), + parameters (>= 0.18.2), + performance (>= 0.9.2), + datawizard (>= 0.5.1), stats, utils Suggests: diff --git a/R/convert_stat_to_anova.R b/R/convert_stat_to_anova.R index f8edf08ca..960a1ece7 100644 --- a/R/convert_stat_to_anova.R +++ b/R/convert_stat_to_anova.R @@ -83,7 +83,7 @@ #' F_to_f(16.501, 1, 9) #' } #' -#' #' @examplesIf require(lmerTest) +#' #' @examplesIf require(emmeans) #' \donttest{ #' ## Use with emmeans based contrasts #' ## -------------------------------- diff --git a/README.Rmd b/README.Rmd index fc8ffa34d..95d12968a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -34,7 +34,7 @@ The goal of this package is to provide utilities to work with indices of effect [![CRAN](https://www.r-pkg.org/badges/version/effectsize)](https://cran.r-project.org/package=effectsize/) [![effectsize status badge](https://easystats.r-universe.dev/badges/effectsize/)](https://easystats.r-universe.dev/) -[![R-check](https://github.com/easystats/effectsize/workflows/R-check/badge.svg/)](https://github.com/easystats/effectsize/actions/) +[![R-CMD-check](https://github.com/easystats/effectsize/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/easystats/effectsize/actions) [![pkgdown](https://github.com/easystats/effectsize/workflows/pkgdown/badge.svg/)](https://github.com/easystats/effectsize/actions/) [![Codecov test coverage](https://codecov.io/gh/easystats/effectsize/branch/main/graph/badge.svg/)](https://app.codecov.io/gh/easystats/effectsize?branch=main/) diff --git a/README.md b/README.md index 28e66fcaf..5bb4eb286 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![downloads](https://cranlogs.r-pkg.org/badges/effectsize)](https://cran.r-project.org/package=effectsize/) [![total](https://cranlogs.r-pkg.org/badges/grand-total/effectsize)](https://cran.r-project.org/package=effectsize/) [![status](https://tinyverse.netlify.com/badge/effectsize/)](https://CRAN.R-project.org/package=effectsize/) +[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html) ***Significant is just not enough!*** @@ -17,7 +18,7 @@ conversion of indices such as Cohen’s *d*, *r*, odds-ratios, etc. [![CRAN](https://www.r-pkg.org/badges/version/effectsize)](https://cran.r-project.org/package=effectsize/) [![effectsize status badge](https://easystats.r-universe.dev/badges/effectsize/)](https://easystats.r-universe.dev/) -[![R-check](https://github.com/easystats/effectsize/workflows/R-check/badge.svg/)](https://github.com/easystats/effectsize/actions/) +[![R-CMD-check](https://github.com/easystats/effectsize/workflows/R-CMD-check/badge.svg?branch=main)](https://github.com/easystats/effectsize/actions) [![pkgdown](https://github.com/easystats/effectsize/workflows/pkgdown/badge.svg/)](https://github.com/easystats/effectsize/actions/) [![Codecov test coverage](https://codecov.io/gh/easystats/effectsize/branch/main/graph/badge.svg/)](https://app.codecov.io/gh/easystats/effectsize?branch=main/) @@ -29,7 +30,7 @@ CRAN: install.packages("effectsize") ``` -Or you can install the latest development version `0.7.0.1` from +Or you can install the latest development version `0.7.0.9999` from [*R-universe*](https://easystats.r-universe.dev): ``` r diff --git a/man/F_to_eta2.Rd b/man/F_to_eta2.Rd index a76bbcbb8..247ff46fa 100644 --- a/man/F_to_eta2.Rd +++ b/man/F_to_eta2.Rd @@ -190,7 +190,7 @@ F_to_epsilon2(16.501, 1, 9) F_to_f(16.501, 1, 9) } -#' @examplesIf require(lmerTest) +#' @examplesIf require(emmeans) \donttest{ ## Use with emmeans based contrasts ## --------------------------------