Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyokc committed Oct 1, 2023
0 parents commit 14a3714
Show file tree
Hide file tree
Showing 44 changed files with 2,176 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
^renv$
^renv\.lock$
CODE_OF_CONDUCT.md
SECURITY.md
^.*\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
^vignettes/hello\.Rmd$
^docs$
^\.github$
README.*
^\.lintr$
^staged_dependencies\.yaml$
coverage.*
^\.pre-commit-config\.yaml$
^codemeta\.json$
init.sh
workflows.md
images
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
79 changes: 79 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: Check 🛠

on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
push:
branches:
- main
workflow_dispatch:

jobs:
audit:
name: Audit Dependencies 🕵️‍♂️
uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@main
r-cmd:
name: R CMD Check 🧬
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
additional-r-cmd-check-params: --as-cran
coverage:
name: Coverage 📔
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linter:
if: github.event_name == 'pull_request'
name: SuperLinter 🦸‍♀️
uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@main
roxygen:
name: Roxygen 🅾
uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
auto-update: true
gitleaks:
name: gitleaks 💧
uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@main
spelling:
if: github.event_name == 'pull_request'
name: Spell Check 🆎
uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@main
links:
if: github.event_name == 'pull_request'
name: Check URLs 🌐
uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@main
vbump:
name: Version Bump 🤜🤛
if: github.event_name == 'push'
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
version:
name: Version Check 🏁
uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@main
licenses:
name: License Check 🃏
uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@main
style:
if: github.event_name == 'pull_request'
name: Style Check 👗
uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main
with:
auto-update: true
grammar:
if: github.event_name == 'pull_request'
name: Grammar Check 🔤
uses: insightsengineering/r.pkg.template/.github/workflows/grammar.yaml@main
41 changes: 41 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Docs 📚

on:
push:
branches:
- main
paths:
- "inst/templates/**"
- "_pkgdown.y[a]ml"
- DESCRIPTION
- "**.md"
- "**.Rmd"
- "man/**"
- "LICENSE.*"
- NAMESPACE
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
paths:
- "inst/templates/**"
- "_pkgdown.y[a]ml"
- DESCRIPTION
- "**.md"
- "**.Rmd"
- "man/**"
- "LICENSE.*"
- NAMESPACE
workflow_dispatch:

jobs:
docs:
name: Pkgdown Docs 📚
uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/post-release.yaml.shared
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Post release ✨

on:
release:
types: ["released"]

jobs:
vbump:
name: Version Bump 🤜🤛
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
vbump-after-release: true
54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Release 🎈

on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
build:
name: Build package 🎁
needs: release
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skip-r-cmd-check: true
skip-r-cmd-install: true
docs:
name: Pkgdown Docs 📚
needs: release
uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
default-landing-page: latest-tag
validation:
name: R Package Validation report 📃
needs: release
uses: insightsengineering/r.pkg.template/.github/workflows/validation.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create release 🎉
uses: insightsengineering/r.pkg.template/.github/workflows/release.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
r-cmd:
name: R CMD Check 🧬
needs: [release, docs]
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
additional-r-cmd-check-params: --as-cran
coverage:
name: Coverage 📔
needs: [release, docs]
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/scheduled.yaml.shared
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Scheduled 🕰️

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

jobs:
dependency-test:
strategy:
fail-fast: false
matrix:
test-strategy: ["min", "release", "max"]
uses: insightsengineering/r.pkg.template/.github/workflows/verdepcheck.yaml@main
name: Dependency Test - ${{ matrix.test-strategy }} 🔢
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GCHAT_WEBHOOK: ${{ secrets.GCHAT_WEBHOOK }}
with:
strategy: ${{ matrix.test-strategy }}
additional-env-vars: |
PKG_SYSREQS_DRY_RUN=true
branch-cleanup:
name: Branch Cleanup 🧹
uses: insightsengineering/r.pkg.template/.github/workflows/branch-cleanup.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.DS_Store
.httr-oauth
.project
.RData
.Rhistory
.Rproj.user
.Ruserdata
.settings/**
*.html
*.Rcheck
*.rprof
*.sas.txt
*~
/.project
devel/*
doc
docs
inst/outputs/*
logs
Meta
packrat/lib*/
temp
temp_w
templates/
tmp.*
vignettes/*.html
vignettes/*.md
vignettes/*.R
coverage.*
.vscode/
node_modules/
package-lock.json
package.json
5 changes: 5 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linters: linters_with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
object_usage_linter = NULL
)
82 changes: 82 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
# All available hooks: https://pre-commit.com/hooks.html
# R specific hooks: https://github.com/lorenzwalthert/precommit
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.3.2.9013
hooks:
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style]
- id: roxygenize
additional_dependencies:
- plumber
- shiny
# codemeta must be above use-tidy-description when both are used
# - id: codemeta-description-updated
- id: use-tidy-description
- id: spell-check
exclude: >
(?x)^(
data/.*|
(.*/|)\.Rprofile|
(.*/|)\.Renviron|
(.*/|)\.gitignore|
(.*/|)NAMESPACE|
(.*/|)DESCRIPTION|
(.*/|)WORDLIST|
(.*/|)LICENSE|
(.*/|)\.Rbuildignore|
(.*/|)\.lintr|
(.*/|)_pkgdown.yaml|
(.*/|)staged_dependencies.yaml|
(.*/|)\.pre-commit-.*|
\.github/.*|
.*\.[rR]|
.*\.Rproj|
.*\.py|
.*\.png|
.*\.feather|
.*\.rds|
.*\.Rds|
.*\.sh|
.*\.RData
)$
- id: lintr
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: deps-in-desc
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ["--maxkb=200"]
- id: end-of-file-fixer
exclude: '\.Rd'
- id: trailing-whitespace
exclude: '\.Rd'
- id: check-yaml
- id: no-commit-to-branch
- id: mixed-line-ending
args: ["--fix=lf"]
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key
- id: forbid-new-submodules
- id: check-symlinks
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit common R artifacts
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
language: fail
files: '\.Rhistory|\.RData|\.Rds|\.rds$'
# `exclude: <regex>` to allow committing specific files.
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint
31 changes: 31 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Type: Package
Package: anthonyverse
Title: R Package Template
Version: 0.1.0
Date: 2023-07-05
Authors@R:
person("anthonyokc", , , "anthonyokc@example.com", role = c("aut", "cre"))
Description: R package template with GitHub Actions workflows included.
License: Apache License 2.0 | file LICENSE
URL: https://github.com/anthonyokc/anthonyverse/
BugReports: https://github.com/anthonyokc/anthonyverse/issues
Depends:
R (>= 3.6)
Imports:
plumber,
shiny,
stringr
Suggests:
future,
httr,
knitr,
shinytest,
testthat (>= 2.0)
VignetteBuilder:
knitr
biocViews:
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Loading

0 comments on commit 14a3714

Please sign in to comment.