Skip to content

Commit

Permalink
Add more GHA workflows: strict check, vignette warnings, spell check (#…
Browse files Browse the repository at this point in the history
…829)

* Add metadata GHA workflow

* Apply automatic changes

* update meta

* Update metadata.yaml

* Apply automatic changes

* retrigger CI

* Update metadata.yaml

* Apply automatic changes

* add schedules and error on changed lints

* clean up lints in code for creating datasets

* Update check-all-examples.yaml

* Update check-all-examples.yaml

* Create check-vignette-warnings.yaml

* silence ggside warnings; update ggcoef snapshots

* Apply automatic changes

* needs devel easystats?

* Apply automatic changes

* revert snapshot changes

* Apply automatic changes

* fix vignette warning

* Apply automatic changes

* improve idiom for conditional evaluation

* Apply automatic changes

* remove missing values in ggsignif

* Apply automatic changes

* remove manova example

* Apply automatic changes

* use devel performance

* Apply automatic changes

* avoid unneeded computations

* Apply automatic changes

* add strict workflow

* Apply automatic changes

* remove metadata workflow [skip ci]

* Update R-CMD-check-strict.yaml

* bump purrr version

* minor [skip ci]

* add spell check workflow

* minor [skip ci]

* use svglite device

closes #812

* dealing with more warnings

* Apply automatic changes

* Update DESCRIPTION

* fix build issues

* sigh; I give up

* skip problematic chunk

* Update faq.Rmd

* Apply automatic changes

* Update ggbetweenstats.Rmd

* remove svglite for now

Co-authored-by: IndrajeetPatil <[email protected]>
  • Loading branch information
IndrajeetPatil and IndrajeetPatil authored Jan 14, 2023
1 parent 46ce94b commit ade608e
Show file tree
Hide file tree
Showing 45 changed files with 500 additions and 328 deletions.
41 changes: 41 additions & 0 deletions .github/experimental-workflows/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
pull_request:
branches: [main, master]

name: metadata

jobs:
metadata:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
extra-packages: |
local::.
cboettig/codemeta
ropensci/cffr
- name: Generate codemeta metadata
run: |
options(crayon.enabled = TRUE)
codemeta::write_codemeta()
shell: Rscript {0}

- name: Generate CFF metadata
run: |
options(crayon.enabled = TRUE)
cffr::cff_write()
shell: Rscript {0}

- uses: stefanzweifel/git-auto-commit-action@v4
60 changes: 60 additions & 0 deletions .github/workflows/R-CMD-check-strict.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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
#
# R CMD Check will fail on NOTE.
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# * is a special character in YAML so you have to quote this string
# Trigger once a week at 00:00 on Sunday
- cron: "0 0 * * SUN"

name: R-CMD-check-strict

jobs:
R-CMD-check-strict:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
# CRAN does not provide macOS binaries for R-devel, so some packages
# need to be built from source. To avoid that, use R-release.
- { os: macos-latest, r: "release" }
- { os: windows-latest, r: "devel" }
- { os: ubuntu-latest, r: "devel" }

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: "2.19.2"

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: "release"
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
needs: check
extra-packages: |
any::rcmdcheck
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
upload-results: true
error-on: '"note"'
18 changes: 10 additions & 8 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 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]
Expand All @@ -19,16 +18,18 @@ jobs:
fail-fast: false
matrix:
config:
# Checks are not run on R-devel because they are already run in
# `R-CMD-check-strict` workflow

#- { os: macos-latest, r: 'devel' }
- { os: macos-latest, r: "release" }
#- { os: macos-latest, r: "release" }
- { os: macos-latest, r: "oldrel-1" }

- { os: windows-latest, r: "devel" }
#- { os: windows-latest, r: "devel" }
- { os: windows-latest, r: "release" }
# DLL 'purrr' not found: maybe not installed for this architecture?
#- { os: windows-latest, r: "oldrel-1" }
- { os: windows-latest, r: "oldrel-1" }

- { os: ubuntu-latest, r: "devel", http-user-agent: "release" }
#- { os: ubuntu-latest, r: "devel", http-user-agent: "release" }
- { os: ubuntu-latest, r: "release" }
- { os: ubuntu-latest, r: "oldrel-1" }

Expand All @@ -46,13 +47,14 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
http-user-agent: "release"
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
extra-packages: any::rcmdcheck
extra-packages: |
any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/check-all-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# * is a special character in YAML so you have to quote this string
# Trigger once a week at 00:00 on Sunday
- cron: "0 0 * * SUN"

name: check-all-examples

Expand All @@ -26,6 +30,7 @@ jobs:

- uses: r-lib/actions/setup-r@v2
with:
r-version: "devel"
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
Expand All @@ -38,5 +43,5 @@ jobs:
- name: Run examples
run: |
options(crayon.enabled = TRUE, warn = 2L)
devtools::run_examples(fresh = TRUE, run_dontrun = TRUE, run_donttest = TRUE)
devtools::run_examples(run_dontrun = TRUE, run_donttest = TRUE, document = FALSE)
shell: Rscript {0}
6 changes: 5 additions & 1 deletion .github/workflows/check-link-rot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# * is a special character in YAML so you have to quote this string
# Trigger once a week at 00:00 on Sunday
- cron: "0 0 * * SUN"

name: check-link-rot

Expand Down Expand Up @@ -38,6 +42,6 @@ jobs:
rotten_links <- urlchecker::url_check(progress = FALSE)
print(rotten_links)
if (length(rotten_links$URL) > 0L) {
stop("Some URLs are outdated and need to be updated.", call. = FALSE)
cli::cli_abort("Some URLs are outdated and need to be updated.")
}
shell: Rscript {0}
52 changes: 52 additions & 0 deletions .github/workflows/check-spelling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# * is a special character in YAML so you have to quote this string
# Trigger once a week at 00:00 on Sunday
- cron: "0 0 * * SUN"

name: check-spelling

jobs:
check-spelling:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: "2.19.2"

- uses: r-lib/actions/setup-r@v2
with:
r-version: "devel"
http-user-agent: "release"
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
dependencies: '"hard"'
extra-packages: |
any::rcmdcheck
any::spelling
- name: Spell check
run: |
options(crayon.enabled = TRUE)
spelling_mistakes <- spelling::spell_check_package()
cli::cli_rule()
if (length(spelling_mistakes$word) > 0L) {
print(spelling_mistakes)
cli::cli_abort("Spelling errors found. Either correct them or update `inst/WORDLIST` file.")
} else {
cli::cli_alert_success("No spelling errors found.")
}
cli::cli_rule()
shell: Rscript {0}
1 change: 1 addition & 0 deletions .github/workflows/check-test-warnings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:

- uses: r-lib/actions/setup-r@v2
with:
r-version: "devel"
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/check-vignette-warnings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Run vignettes with `options(warn = 2)` to fail on warnings
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: check-vignette-warnings

jobs:
check-vignette-warnings:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: "2.19.2"

- uses: r-lib/actions/setup-r@v2
with:
r-version: "devel"
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
extra-packages: |
local::.
- name: Build vignettes
run: |
# options(crayon.enabled = TRUE, warn = 2L)
vignettes <- fs::dir_ls("vignettes/", glob = "*.Rmd", recurse = TRUE)
purrr::walk(vignettes, rmarkdown::render)
shell: Rscript {0}
5 changes: 0 additions & 5 deletions .github/workflows/lint-changed-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
any::purrr
needs: check

- name: Add lintr options
run: |
cat('\noptions(lintr.linter_file = ".lintr")\n', file = "~/.Rprofile", append = TRUE)
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
# * is a special character in YAML so you have to quote this string
# Trigger once a week at 00:00 on Sunday
- cron: "0 0 * * SUN"

name: lint

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/styler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Style package
run: |
options(crayon.enabled = TRUE)
styler::style_pkg(filetype = c(".R", ".Rmd", ".Rmarkdown", ".Rnw"))
styler::style_pkg(filetype = c(".qmd", ".R", ".Rmd", ".Rmarkdown", ".Rnw"))
shell: Rscript {0}

- name: Document
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
options(crayon.enabled = TRUE)
library(covr)
coverage <- covr::package_coverage(
type = "examples",
type = c("examples", "vignettes"),
quiet = TRUE,
commentDonttest = FALSE,
commentDontrun = FALSE
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
Meta
doc
docs

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# OSX
.AppleDouble
.DS_Store
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.fseventsd

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
.apdisk
Network Trash Folder
Temporary Items

# R Studio files
.RData
.Rhistory
Expand Down
Loading

0 comments on commit ade608e

Please sign in to comment.