Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update workflows to match packagetemplate #248

Merged
merged 12 commits into from
May 17, 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
51 changes: 0 additions & 51 deletions .github/CONTRIBUTING.md

This file was deleted.

26 changes: 0 additions & 26 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

25 changes: 0 additions & 25 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

14 changes: 10 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

# 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
#
# Reproduce locally by running:
# ```r
# pak::pak(c("any::rcmdcheck", "."), dependencies = "Config/Needs/check")
# rcmdcheck::rcmdcheck()
# ```
on:
push:
branches: [main, master]
Expand All @@ -16,8 +23,8 @@ on:
- 'LICENSE'
- '.Rbuildignore'
- '.github/workflows/R-CMD-check.yaml'
merge_group:
pull_request:
branches: [main, master]
paths:
- 'data/**'
- 'R/**'
Expand Down Expand Up @@ -48,7 +55,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -57,8 +64,6 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
# Exists since R 4.3.0 but `false` by default
_R_CHECK_LENGTH_COLON_: true

steps:
- uses: actions/checkout@v4
Expand All @@ -80,6 +85,7 @@ jobs:
id: rcmdcheck
with:
upload-snapshots: true
error-on: '"note"'

# fail-fast but only if rcmdcheck step fails
- name: Manual fail-fast
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/dependency-change.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:

message("Dependencies have changed! Analyzing...")

if (nrow(deps_added) > 0) {
nudge <- "Reach out on slack (`#code-review` or `#help` channels) to double check if there are base R alternatives to the new dependencies.\n"
} else {
nudge <- ""
}

msg <- glue::glue(
.sep = "\n",
"This pull request:",
Expand All @@ -60,7 +66,8 @@ jobs:
"- Removes {nrow(deps_removed)} existing dependencies (direct and indirect)",
"- Removes {length(unique(deps_removed$sysreqs))} existing system dependencies",
"",
"(Note that results may be inacurrate if you branched from an outdated version of the target branch.)"
nudge,
"(Note that results may be inaccurate if you branched from an outdated version of the target branch.)"
)

message("Posting results as a pull request comment.")
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint-changed-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
workflow_dispatch:
pull_request:
branches: [main, master]
paths:
- '**.R'
- '**.Rmd'
- '**/.lintr'
- '**/.lintr.R'

name: lint-changed-files

Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- 'DESCRIPTION'
- '.Rbuildignore'
- '.github/**'
merge_group:
pull_request:
paths:
- 'README.Rmd'
Expand All @@ -44,13 +45,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand All @@ -69,8 +71,13 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Check website links
uses: untitaker/[email protected]
with:
args: docs/

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
if: github.event_name != 'merge_group' && github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
# We clean on releases because we want to remove old vignettes,
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 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
#
# Reproduce locally by running:
# ```r
# pak::pak("any::covr", dependencies = "Config/Needs/coverage")
# covr::codecov(quiet = FALSE)
# ```
on:
push:
branches: [main, master]
Expand All @@ -10,8 +16,8 @@ on:
- 'inst/**'
- 'DESCRIPTION'
- '.github/workflows/test-coverage.yaml'
merge_group:
pull_request:
branches: [main, master]
paths:
- 'R/**'
- 'src/**'
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/update-citation-cff.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@

# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# The action runs when:
# - A new release is published
# - The DESCRIPTION or inst/CITATION are modified
# - Can be run manually
# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
release:
types: [published]
push:
branches:
- main
paths:
- DESCRIPTION
- inst/CITATION
- .github/workflows/update-citation-cff.yaml
workflow_dispatch:

name: Update CITATION.cff
permissions:
contents: write
pull-requests: write

jobs:
update-citation-cff:
Expand All @@ -29,21 +32,29 @@ jobs:
extra-packages: |
any::cffr
any::V8

- name: Update CITATION.cff
run: |

library(cffr)

# Customize with your own code
# See https://docs.ropensci.org/cffr/articles/cffr.html

# Write your own keys
mykeys <- list()

# Create your CITATION.cff file
cff_write(keys = mykeys)

shell: Rscript {0}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update `CITATION.cff`
title: Update `CITATION.cff`
body: |
This pull request updates the citation file, ensuring all authors are credited and there are no discrepancies.

- name: Commit results
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CITATION.cff
git commit -m 'Update CITATION.cff' || echo "No changes to commit"
git push origin || echo "No changes to commit"
Please verify the changes before merging.
branch: update-citation-cff
37 changes: 37 additions & 0 deletions .github/workflows/update-copyright-year.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update copyright year(s) in license file

on:
workflow_dispatch:
schedule:
- cron: '0 3 1 1 *'

permissions:
contents: write
pull-requests: write

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: |
LICENSE.md
prBody: >
This PR updates the copyright license for this new year! If you're reading this while you're celebrating, enjoy! Don't worry about this one :blush:

![Happy new year!](https://media.giphy.com/media/HyDfNCZlTn5iU/giphy.gif?cid=ecf05e4777yl7dbo1xfha6bx1z5lrl13uq7biv6rs9dqsyoh&ep=v1_gifs_search&rid=giphy.gif&ct=g)
- uses: FantasticFiasco/action-update-license-year@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: |
LICENSE
prBody: >
This PR updates the copyright license for this new year! If you're reading this while you're celebrating, enjoy! Don't worry about this one :blush:

![Happy new year!](https://media.giphy.com/media/HyDfNCZlTn5iU/giphy.gif?cid=ecf05e4777yl7dbo1xfha6bx1z5lrl13uq7biv6rs9dqsyoh&ep=v1_gifs_search&rid=giphy.gif&ct=g)
transform: (?<=YEAR:\s)(?<from>\d{4})?-?(\d{4})?
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ To report a bug please open an [issue](https://github.com/epiverse-trace/epichai

## Contribute

We welcome contributions to enhance the package's functionalities. If you
wish to do so, please follow the [package contributing guide](https://github.com/epiverse-trace/epichains/blob/main/.github/CONTRIBUTING.md).
Contributions to {epichains} are welcomed. Please follow the [package contributing guide](https://github.com/epiverse-trace/.github/blob/main/CONTRIBUTING.md).

## Code of conduct

Expand Down
Loading
Loading