Skip to content

Commit

Permalink
add/update workflows: linter, website creation (devel/release) (#3)
Browse files Browse the repository at this point in the history
* add/update workflows: linter, website creation (devel/release)

* fixed testthat

---------

Co-authored-by: Yuri05 <[email protected]>
  • Loading branch information
Yuri05 and Yuri05 authored Mar 7, 2024
1 parent a8e872b commit 970c8d6
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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, pull_request]

name: lint

jobs:
lint:
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Install ospsuite ecosystem and cran packages
run: |
Rscript .github/workflows/install_dependencies.R
- name: Install lintr
run: Rscript -e "install.packages('lintr',repos='http://cran.rstudio.com/')"

- name: Lint
run: |
Rscript .github/workflows/run_lintr.R
15 changes: 15 additions & 0 deletions .github/workflows/run_lintr.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pkgload::load_all()

lintr::lint_package(
linters=lintr::linters_with_defaults(
object_name_linter=lintr::object_name_linter(styles=c("camelCase","CamelCase","symbols")),
line_length_linter=NULL,
object_length_linter=NULL,
brace_linter=NULL,
paren_body_linter=NULL,
trailing_whitespace_linter=NULL,
trailing_blank_lines_linter=NULL,
spaces_left_parentheses_linter=NULL,
infix_spaces_linter=NULL
)
)
16 changes: 16 additions & 0 deletions .github/workflows/update-dev-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Update dev website
on:
push:
branches:
- develop

# The action needs permissions to update the branch
permissions:
contents: write

jobs:
update_dev_website:
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/CreateGitHubPagesForR.yml@main
with:
pkgdown_mode: 'devel'
# extra_r_packages: 'github::Open-Systems-Pharmacology/OSPSuite.RUtils'
17 changes: 17 additions & 0 deletions .github/workflows/update-release-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Update release website
# The action is triggered only when update is push on main branch
on:
push:
branches:
- main

# The action needs permissions to update the branch
permissions:
contents: write

jobs:
update_release_website:
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/CreateGitHubPagesForR.yml@main
with:
pkgdown_mode: 'release'
# extra_r_packages: 'github::Open-Systems-Pharmacology/OSPSuite.RUtils'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
inst/doc
/doc/
/Meta/
/docs
29 changes: 29 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Type: Package
Package: ospsuite.globalsensitivity
Title: TODO
Version: 0.1.0
Authors@R: c(
person("Open-Systems-Pharmacology Community", role = c("cph", "fnd")),
person("XXXXXXXXXXX", "XXXXXXXXXXXX", , "[email protected]", role = c("aut", "cre"))
)
Maintainer: XXXXXXXXXXX XXXXXXXXXXX <[email protected]>
Description: TODO
License: GPL-2
URL: https://github.com/Open-Systems-Pharmacology/OSPSuite.GlobalSensitivitys,
https://www.open-systems-pharmacology.org/OSPSuite.GlobalSensitivity/
BugReports:
https://github.com/Open-Systems-Pharmacology/OSPSuite.GlobalSensitivity/issues
Depends:
R (>= 4.1)
Imports:
Suggests:
knitr,
rmarkdown,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Collate:
'dummy.R'
15 changes: 15 additions & 0 deletions R/dummy.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#' Dummy function
#'
#' @description
#' Dummy function
#'
#' @return
#' Returns zero.
#'
#' @examples
#' XXXXXX_dummyFunction()
#'
#' @export
XXXXXX_dummyFunction <- function() {
return(0)
}
4 changes: 2 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ template:
bootstrap: 5

development:
mode: devel
mode: !expr Sys.getenv('PKGDOWN_MODE')

articles:
- title: XXXXXX
navbar: XXXXXX
desc: XXXXXX
contents:
- vignette1_XXXXXXXXXXXXXXXXXXXXX
# - vignette1_XXXXXXXXXXXXXXXXXXXXX

reference:
- title: "XXXXXXXXXXXXXXXXXXX"
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
library(testthat)
library(ospsuite.plots)

test_check("ospsuite.plots", encoding = "utf-8")
test_check("ospsuite.globalsensitivity", encoding = "utf-8")

0 comments on commit 970c8d6

Please sign in to comment.