-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add github actions for test and release * enable pre-commit * Remove python deps * fix syntax * Roxygenize with pre-commit * Update pre-commit hook * Add missing params documentation * Set workflow permissions * autofixes * pre-commit autofixes * disable autoformatting in certain unit tests * pre-commit autofixes * pre-commit autofixes * Fix missing params docs * pre-commit autofixes * trigger CI * updated to remove warnings * updated dsoParams class to remove warnings; * pre-commit autofixes * trigger CI * updated .Rbuildignore * updated * updated dsoparams class * bumped version * pre-commit autofixes * trigger CI --------- Co-authored-by: grst <[email protected]> Co-authored-by: zxBIB Schreyer,Daniel (TMCP Data Sc) EXTERNAL <[email protected]> Co-authored-by: DSchreyer <[email protected]>
- Loading branch information
1 parent
6d8115b
commit 1b7a290
Showing
23 changed files
with
414 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^\.pre-commit-config\.yaml$ | ||
^\.github$ | ||
^CHANGELOG\.md$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
name: pre-commit | ||
|
||
jobs: | ||
pre-commit: | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
|
||
- 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 | ||
|
||
- uses: pre-commit/[email protected] | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
if: '!cancelled()' | ||
with: | ||
commit_message: pre-commit autofixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build and Attach R Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: release | ||
http-user-agent: release | ||
use-public-rspm: true | ||
|
||
- name: Build package | ||
run: | | ||
R CMD build . | ||
FILENAME=$(ls dso_*.tar.gz) | ||
echo "FILENAME=${FILENAME}" >> $GITHUB_ENV | ||
- name: Check version | ||
run: | | ||
VERSION=$(echo $FILENAME | sed 's/.*_\(.*\).tar.gz/\1/') | ||
if [ "v${VERSION}" != "${GITHUB_REF#refs/tags/}" ]; then | ||
echo "Version mismatch. Tag version and package version should be the same." | ||
exit 1 | ||
fi | ||
- name: Attach tarball to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./${{ env.FILENAME }} | ||
asset_name: ${{ env.FILENAME }} | ||
asset_content_type: application/gzip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# The purpose of this workflow is to execute `R CMD check` on different R and OS version. | ||
# | ||
# 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: macOS-latest, r: "release" } | ||
- { os: windows-latest, r: "release" } | ||
- { os: ubuntu-latest, r: "devel", http-user-agent: "release" } | ||
- { os: ubuntu-latest, r: "release" } | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 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.4.3 | ||
hooks: | ||
- id: style-files | ||
args: [--style_pkg=styler, --style_fun=tidyverse_style, --scope=tokens] | ||
- id: parsable-R | ||
- id: no-browser-statement | ||
- id: no-debug-statement | ||
- id: deps-in-desc | ||
args: [--allow_private_imports] | ||
- id: roxygenize | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
exclude: '\.Rd' | ||
- id: detect-private-key | ||
- id: check-ast | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- id: trailing-whitespace | ||
- id: check-case-conflict | ||
# Check that there are no merge conflicts (could be generated by template sync) | ||
- id: check-merge-conflict | ||
args: [--assume-in-merge] | ||
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config | ||
rev: v1.5.1 | ||
hooks: | ||
# Only reuiqred when https://pre-commit.ci is used for config validation | ||
- id: check-pre-commit-ci-config | ||
- 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: "(inst/extdata|data)/.*" | ||
# - repo: https://github.com/pre-commit/mirrors-prettier | ||
# rev: v3.0.0-alpha.6 | ||
# hooks: | ||
# - id: prettier | ||
# language_version: "17.9.1" | ||
|
||
ci: | ||
autoupdate_schedule: monthly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
Package: dso | ||
Type: Package | ||
Title: dso R companion package | ||
Version: 0.4.2 | ||
Title: dso R companion package | ||
Version: 0.4.3 | ||
Author: Daniel Schreyer<[email protected]>, | ||
Gregor Sturm<[email protected]>, | ||
Gregor Sturm<[email protected]>, | ||
Thomas Schwarzl<[email protected]> | ||
Maintainer: Daniel Schreyer<[email protected]>, | ||
Gregor Sturm<[email protected]>, | ||
Gregor Sturm<[email protected]>, | ||
Thomas Schwarzl<[email protected]> | ||
Description: Collection of functions used with the DevOps dso application. | ||
Description: Collection of functions used with the DevOps dso application. | ||
License: GPL-3 + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
yaml, | ||
glue, | ||
here | ||
RoxygenNote: 7.3.1 | ||
Suggests: | ||
here, | ||
stringr, | ||
methods, | ||
rlang | ||
RoxygenNote: 7.3.2 | ||
Suggests: | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.