From 41dba55e0b800b6c7d4493fc4b994ce92a54d8ac Mon Sep 17 00:00:00 2001
From: Dan Chaltiel <15105152+DanChaltiel@users.noreply.github.com>
Date: Thu, 12 Sep 2024 14:20:24 +0200
Subject: [PATCH] add GHA and templates
---
.github/.gitignore | 1 +
.github/ISSUE_TEMPLATE/bug_report.md | 22 ++++++++
.github/ISSUE_TEMPLATE/feature_request.md | 14 ++++++
.github/workflows/bump_dev_version.yaml | 20 ++++++++
.github/workflows/check-standard.yaml | 47 +++++++++++++++++
.github/workflows/pkgdown.yaml | 61 +++++++++++++++++++++++
6 files changed, 165 insertions(+)
create mode 100644 .github/.gitignore
create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md
create mode 100644 .github/workflows/bump_dev_version.yaml
create mode 100644 .github/workflows/check-standard.yaml
create mode 100644 .github/workflows/pkgdown.yaml
diff --git a/.github/.gitignore b/.github/.gitignore
new file mode 100644
index 0000000..d3fc626
--- /dev/null
+++ b/.github/.gitignore
@@ -0,0 +1 @@
+*.html
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..4c98093
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,22 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: bug
+assignees: ''
+
+---
+
+**Describe the bug**
+Please be as clear and thorough as possible.
+
+**Reproducible example**
+Share the code that caused the bug, along with all error and warning messages.
+Please also use `dput(df)` to provide a sample dataset so I can reproduce the error. If your dataset is too large, select a minimal number of columns and rows, or use https://pastebin.com/.
+
+**Session info**
+
+``` r
+ #Paste here the output of `sessionInfo()` here
+```
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..481aaf0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,14 @@
+---
+name: Feature request
+about: Suggest an improvement
+title: ''
+labels: feature
+assignees: ''
+
+---
+
+**Describe the new feature**
+Please be as clear and thorough as possible.
+
+**Known workaround**
+If you know any workaround, please share the code here.
diff --git a/.github/workflows/bump_dev_version.yaml b/.github/workflows/bump_dev_version.yaml
new file mode 100644
index 0000000..a9311b8
--- /dev/null
+++ b/.github/workflows/bump_dev_version.yaml
@@ -0,0 +1,20 @@
+on: [push, workflow_dispatch]
+
+name: Bump dev version
+
+jobs:
+ update_version:
+ runs-on: ubuntu-latest
+ env:
+ GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+ - name: Set up R
+ uses: r-lib/actions/setup-r@v2
+ with:
+ install-r: false
+ - name: Bump dev version
+ uses: DanChaltiel/actions/bump-dev-version@v1
+ with:
+ create-tag: 'true'
diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/check-standard.yaml
new file mode 100644
index 0000000..1f14ef2
--- /dev/null
+++ b/.github/workflows/check-standard.yaml
@@ -0,0 +1,47 @@
+# 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]
+
+name: R-CMD-check
+
+jobs:
+ R-CMD-check:
+ runs-on: ${{ matrix.config.os }}
+
+ name: ${{ matrix.config.os }} (${{ matrix.config.r }})
+
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - {os: windows-latest, r: 'devel', http-user-agent: 'release'}
+ - {os: windows-latest, r: 'release'}
+ - {os: windows-latest, r: 'oldrel-1'}
+
+ env:
+ GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
+ R_KEEP_PKG_SOURCE: yes
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: r-lib/actions/setup-pandoc@v2
+
+ - uses: r-lib/actions/setup-r@v2
+ with:
+ r-version: ${{ matrix.config.r }}
+ http-user-agent: ${{ matrix.config.http-user-agent }}
+ use-public-rspm: true
+
+ - uses: r-lib/actions/setup-r-dependencies@v2
+ with:
+ extra-packages: any::rcmdcheck
+ needs: check
+
+ - uses: r-lib/actions/check-r-package@v2
+ with:
+ upload-snapshots: true
diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml
new file mode 100644
index 0000000..d725bda
--- /dev/null
+++ b/.github/workflows/pkgdown.yaml
@@ -0,0 +1,61 @@
+# 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
+
+permissions: read-all
+
+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:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Quarto
+ uses: quarto-dev/quarto-actions/setup@v2
+ with:
+ tinytex: true
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Setup Pandoc
+ uses: r-lib/actions/setup-pandoc@v2
+
+ - name: Setup R
+ uses: r-lib/actions/setup-r@v2
+ with:
+ use-public-rspm: true
+
+ - name: Setup R dependencies
+ uses: r-lib/actions/setup-r-dependencies@v2
+ with:
+ extra-packages: any::pkgdown, local::.
+ needs: website
+
+ - name: Build site
+ run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
+ shell: Rscript {0}
+
+ - name: Deploy to GitHub pages 🚀
+ if: github.event_name != 'pull_request'
+ uses: JamesIves/github-pages-deploy-action@v4.5.0
+ with:
+ clean: false
+ branch: gh-pages
+ folder: docs