Skip to content

Commit

Permalink
Merge branch 'develop' into imgbot
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Sep 14, 2024
2 parents 46e1aab + 130e30b commit 05db2ac
Show file tree
Hide file tree
Showing 139 changed files with 4,327 additions and 659 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^noclocksR\.Rproj$
^noclocksr\.Rproj$
^\.Rproj\.user$
^cliff\.toml$
^CHANGELOG\.md$
Expand Down
9 changes: 9 additions & 0 deletions .github/actions/dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Dependencies

runs:
using: 'composite'
steps:
- name: Install package dependencies 📄
run: |
pak::local_install_deps(".", upgrade=FALSE, ask=FALSE, dependencies = TRUE)
shell: Rscript {0}
144 changes: 100 additions & 44 deletions .github/cliff.toml
Original file line number Diff line number Diff line change
@@ -1,64 +1,120 @@
# configuration file for git-cliff
# see <https://github.com/orhun/git-cliff/blob/main/config/cliff.toml> for default
# see also: <https://www.conventionalcommits.org>
# No Clocks, LLC Custom Configuration Template File for `git-cliff`

[changelog]

# remove the leading and trailing whitespace from the template
trim = true

# header
header = """
# Changelog
*All notable changes to this project will be documented in this file.*\n
# Changelog\n
> All notable changes to this project will be documented in this file. The format is based on
[Keep a Changelog](http://keepachangelog.com/) and this project adheres to
[Semantic Versioning](http://semver.org/).\n
"""

# body - see https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
## [{{ version | trim_start_matches(pat="v") }}]\
{% if previous %}\
{% if previous.version %}\
(REPOSITORY_URL/compare/{{ previous.version }}...{{ version }})\
{% else %}\
(REPOSITORY_URL/tree/{{ version }})\
{% endif %}\
{% endif %}\
- ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
## [Unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
## {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}\
**{{commit.scope}}:** \
{% endif %}\
{% if '```' in commit.message %}\
{{ commit.message | upper_first }}\n\
([{{ commit.id | truncate(length=7, end="") }}](REPOSITORY_URL/commit/{{ commit.id }})) - ({{ commit.author.name }})\
{% else %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](REPOSITORY_URL/commit/{{ commit.id }})) - ({{ commit.author.name }})\
{% endif %}\
{% if commit.breaking %}\
{% for breakingChange in commit.footers %}\
\n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\
{% endfor %}\
{% endif %}\
{% endfor %}
{% endfor %}\n
"""
trim = true

footer = """
***
*Changelog generated by [git-cliff](https://github.com/orhun/git-cliff).*
***
"""

[git]
conventional_commits = true
filter_unconventional = true
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^bug", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^docs", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^app", group = "Application"},
{ message = "^api", group = "API"},
{ message = "^data", group = "Data"},
{ message = "^db", group = "Database"},
{ message = "^refactor", group = "Refactoring"},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^setup", group = "Infrastructure"},
{ message = "^infra", group = "Infrastructure"},
{ message = "^meta", group = "Meta"},
{ message = "^config", group = "Configuration"},
{ message = "^design", group = "Design"},
{ message = "^clean", group = "Cleanup"},
{ message = "^unit", group = "Testing"},
{ message = "^enhance", group = "Features"},
{ message = "^cicd", group = "DevOps"},
{ message = "^config", group = "Configuration"},
{ message = "^deploy", group = "Deployment"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
]
filter_commits = false
filter_commits = true
tag_pattern = "v[0-9]*"
skip_tags = "v0.1.0-beta.1"
skip_tags = "v0.0.0.9999" # "v0.1.0-beta.1"
ignore_tags = ""
topo_order = false
sort_commits = "oldest"
date_order = true
topo_order = true
sort_commits = "newest" # "oldest"
split_commits = false
protect_breaking_commits = true
# limit_commits = 42
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](REPOSITORY_URL/issues/${2}))"},
{ pattern = "Merge pull request #([0-9]+) from [^ ]+", replace = "PR [#${1}](REPOSITORY_URL/pull/${1}):"},
]
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^bug", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^docs", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^app", group = "Application" },
{ message = "^api", group = "API" },
{ message = "^data", group = "Data" },
{ message = "^db", group = "Database" },
{ message = "^refactor", group = "Refactoring" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^setup", group = "Setup" },
{ message = "^infra", group = "Infrastructure" },
{ message = "^meta", group = "Meta" },
{ message = "^config", group = "Configuration" },
{ message = "^design", group = "Design" },
{ message = "^clean", group = "Cleanup" },
{ message = "^unit", group = "Testing" },
{ message = "^enhance", group = "Features" },
{ message = "^cicd", group = "DevOps" },
{ message = "^config", group = "Configuration" },
{ message = "^deploy", group = "Deployment" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks", skip = true },
{ body = ".*security", group = "Security" },
]


# ------------------------------------------------------------------------------
# parse the commits based on https://www.conventionalcommits.org
# filter out the commits that are not conventional
# process each line of a commit as an individual commit
# regex for preprocessing the commit messages
# regex for parsing and grouping commits
# protect breaking changes from being skipped due to matching a skipping commit_parser
# filter out the commits that are not matched by commit parsers
# glob pattern for matching git tags
# regex for skipping tags
# regex for ignoring tags
# sort the tags chronologically
# sort the commits inside sections by oldest/newest order
# limit the number of commits included in the changelog
# ------------------------------------------------------------------------------
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
assignees:
- "jimbrig"
44 changes: 24 additions & 20 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
name: Generate CHANGELOG.md
name: Generate Changelog
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
- develop
branches: [ "main" ]
pull_request:
jobs:
changelog:
name: Generate changelog
name: Generate Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Generate a changelog
uses: orhun/git-cliff-action@v1
- name: Run Git Cliff
uses: tj-actions/[email protected]
id: git-cliff
with:
config: ./.github/cliff.toml
args: --verbose
env:
OUTPUT: ./CHANGELOG.md

- name: Print the changelog
run: cat "${{ steps.git-cliff.outputs.changelog }}"

- name: Commit and Push Changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
args: "--verbose"
output: "CHANGELOG.md"
template-config: "./.github/cliff.toml"
- name: Print Changelog
id: print-changelog
run: |
cat "CHANGELOG.md"
# Commit and push the updated changelog, IF not a pull request
- name: Commit and Push Changelog
if: github.event_name != 'pull_request'
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit -m "[chore]: update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git "main"
30 changes: 30 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check 📦

on:
workflow_call:

concurrency:
group: check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check:
name: ${{ vars.CI_IMAGE }}
runs-on: ubuntu-latest
container:
image: ${{ vars.CI_IMAGE }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout project ⬇️
uses: actions/checkout@v4

- name: Install package dependencies 📄
uses: noclocks/noclocksr/.github/actions/dependencies@main

- name: Check 📦
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(error_on = "error", args = "--no-tests")
shell: Rscript {0}
62 changes: 62 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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:
workflow_dispatch:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: Test Coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
47 changes: 47 additions & 0 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
@@ -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:
workflow_dispatch:
push:
paths: ["R/**"]

name: Document (Roxygen)

permissions: read-all

jobs:
document:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
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
Loading

0 comments on commit 05db2ac

Please sign in to comment.