Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue 126: deprecate style only, style description only, and document only workflows #131

Merged
merged 4 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/style-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Warn about workflow removal
run: |
echo "::warning title=Deprecating style-description workflow::The style-description reusable workflow will be deprecated on 5 December 2024. Use ghactions4r::use_style_and_document() instead to set up a replacement with additional functionality."


- name: Install curl dependency
run: |
sudo apt-get update
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/style-r-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Warn about workflow removal
run: |
echo "::warning title=Deprecating style-r-code workflow::The style-r-code reusable workflow will be deprecated on 5 December 2024. Use ghactions4r::use_style_and_document() instead to set up a replacement with additional functionality."

- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-roxygen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Warn about workflow removal
run: |
echo "::warning title=Deprecating update-roxygen-docs workflow::The update-roxygen-docs reusable workflow will be deprecated on 5 December 2024. Use ghactions4r::use_style_and_document() instead to set up a replacement with additional functionality."

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
Expand Down
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ export(use_connect_publish)
export(use_doc_and_style_r)
export(use_r_cmd_check)
export(use_spell_check)
export(use_style_description)
export(use_style_r_code)
export(use_update_pkgdown)
export(use_update_roxygen_docs)
40 changes: 0 additions & 40 deletions R/use_r_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,46 +204,6 @@ use_build_pkgdown <- function(workflow_name = "call-build-pkgdown.yml") {
)
}

#' use workflow in current pkg to run devtools::document() and submit results as a PR
#' @template workflow_name
#' @export
use_update_roxygen_docs <- function(workflow_name = "call-update-docs.yml") {
usethis::use_github_action("call-update-docs.yml",
save_as = workflow_name,
url = "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-update-docs.yml"
)
usethis::use_git_ignore(ignores = "*.rds", directory = file.path(".github"))
}

#' use workflow in current pkg to run `usethis::use_tidy_description()`
#'
#' Run `usethis::use_tidy_description()` upon changes to the DESCRIPTION file
#' and submit results as a PR.
#' @template workflow_name
#' @export
use_style_description <- function(workflow_name = "call-style-description.yml") {
check_workflow_name(workflow_name)
usethis::use_github_action(
"call-style-description.yml",
save_as = workflow_name,
url = "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-style-description.yml"
)
usethis::use_git_ignore(ignores = "*.rds", directory = file.path(".github"))
}

#' use workflow in current pkg to run styler::style_pkg() and submit results as a PR
#' @template workflow_name
#' @export
use_style_r_code <- function(workflow_name = "call-style.yml") {
check_workflow_name(workflow_name)
usethis::use_github_action("call-style.yml",
save_as = workflow_name,
url = "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-style.yml"
)
usethis::use_git_ignore(ignores = "*.rds", directory = file.path(".github"))
}


#' use workflow in current pkg to build and deploy (update) bookdown
#' Builds the bookdown, then deploys it to a branch in the same repository called gh-pages.
#' The repository must be
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ ghactions4r::use_calc_coverage()
```
(a codecov.io account is also necessary to view the coverage results)

- To update documentation using `devtools::document()`:
```r
ghactions4r::use_update_roxygen_docs()
```

- To update R code styling using `styler::style_pkg()`:
```r
ghactions4r::use_style_r_code()
```

- To update the style of the DESCRIPTION file using `usethis::use_tidy_description()`:
```r
ghactions4r::use_style_description()
```

- To update documentation, DESCRIPTION file, and code styling for an R package (with the option of running `ghactions4r::rm_dollar_sign()`):
```r
ghactions4r::use_doc_and_style_r(use_rm_dollar_sign = FALSE)
Expand Down
17 changes: 0 additions & 17 deletions inst/templates/call-style-description.yml

This file was deleted.

12 changes: 0 additions & 12 deletions inst/templates/call-style.yml

This file was deleted.

11 changes: 0 additions & 11 deletions inst/templates/call-update-docs.yml

This file was deleted.

16 changes: 0 additions & 16 deletions man/use_style_description.Rd

This file was deleted.

15 changes: 0 additions & 15 deletions man/use_style_r_code.Rd

This file was deleted.

15 changes: 0 additions & 15 deletions man/use_update_roxygen_docs.Rd

This file was deleted.

14 changes: 0 additions & 14 deletions tests/testthat/test-use_r_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ test_that("use_build_pkgdown()) works", {
expect_snapshot(test)
})

test_that("use_update_roxygen_docs() works", {
use_update_roxygen_docs()
expect_true(file.exists(".github/workflows/call-update-docs.yml"))
test <- readLines(".github/workflows/call-update-docs.yml")
expect_snapshot(test)
})

test_that("use_style_r_code() works", {
use_style_r_code()
expect_true(file.exists(".github/workflows/call-style.yml"))
test <- readLines(".github/workflows/call-style.yml")
expect_snapshot(test)
})

test_that("use_build_deploy_bookdown() works", {
use_build_deploy_bookdown()
expect_true(file.exists(".github/workflows/call-build-deploy-bookdown.yml"))
Expand Down
Loading