Skip to content

Commit

Permalink
restore github/workflows from 0.99.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jmitchell81 committed Nov 20, 2024
1 parent eed598d commit b758cc9
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/copy_to_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Designate desired directories and files
SRC_FOLDER_PATHS=(data-raw man R tests vignettes)
SRC_FILE_PATHS=(DESCRIPTION LICENSE NAMESPACE NEWS.md README.md inst/CITATION)

# Get files from directories
FILES=$(find "${SRC_FOLDER_PATHS[@]}" -type f)

# Add indicated individual files
for F in "${SRC_FILE_PATHS[@]}"
do
FILES+=" ${F}"
done

echo "${FILES[@]}"

# Pass these to github:
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
# Fetch branches
git fetch
# Checkout target branch
git checkout $TARGET_BRANCH
# copy files from the branch the action is being run upon
SRC_BRANCH=$(git symbolic-ref --short HEAD)
git checkout $SRC_BRANCH -- $FILES
# Commit to the repository (ignore if no changes)
git add -A
git diff-index --quiet HEAD || git commit -am "update files"
# Push to remote branch
git push origin $TARGET_BRANCH
22 changes: 22 additions & 0 deletions .github/workflows/bioc_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Update Bioconductor package files

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

jobs:
copy:
name: Copy files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: copy
env:
TARGET_BRANCH: 'master'
run: .github/copy_to_branch.sh
shell: bash
43 changes: 43 additions & 0 deletions .github/workflows/document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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:
paths: ["R/**"]
workflow_dispatch:

name: documentation-update

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

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

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: roxygen2

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: Commit and push changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE DESCRIPTION
git commit -m "Update documentation" || echo "No changes to commit"
git pull --ff-only
git push origin
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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]
release:
types: [published]
workflow_dispatch:

name: pkgdown-update

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 }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@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::pkgdown
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = TRUE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
18 changes: 18 additions & 0 deletions .github/workflows/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
This is a code review template, it will be displayed after each pull request.
We do code reviews because we care about quality of our codebase and because we care about long-term development goals.
We do not do code reviews to blame the ones who contribute. There is no seniority in this process and there is no perfect code,
we just want to avoid storing code that is not OK.

## For the submitter

- [ ] `R CMD build` & `R CMD check` pass
- [ ] `BiocCheck` passes
- [ ] Needed tests exist and passing or not needed
- [ ] The change is sufficiently small

## For the reviewer

- [ ] OK, code does what it's intended for
- [ ] its' OK to do it that way
- [ ] it's OK to read and comprehend the code
- [ ] tests, documentation, style are OK
10 changes: 10 additions & 0 deletions .github/workflows/r-build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: r-build-check
on:
pull_request:
branches: ['master', 'dev']
workflow_dispatch:

jobs:
build-check:
uses: FertigLab/actions/.github/workflows/r-build-check.yml@v1
secrets: inherit

0 comments on commit b758cc9

Please sign in to comment.