Skip to content

Commit

Permalink
1 job at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Cazelles authored and KevCaz committed Nov 16, 2023
1 parent f426b01 commit ca81fe9
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 3 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/R-CMD-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
on:
workflow_call:
inputs:
pkg-path:
required: true
type: string

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck, any::covr, any::goodpractice, any::lintr
working-directory: ${{ inputs.pkg-path }}

- uses: r-lib/actions/check-r-package@v2
with:
working-directory: ${{ inputs.pkg-path }}

- name: Code coverage
run: covr::package_coverage()
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}

- name: Good practices
run: |
goodpractice::gp(checks = c(
"cyclocomp",
"no_import_package_as_a_whole",
"no_export_pattern"
))
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}

- name: Lint
run: |
library(lintr)
lint_package(linters = with_defaults(object_name_linter("camelCase"), line_length_linter(160L), object_length_linter(length = 60L)))
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
# https://github.com/dorny/paths-filter/issues/66
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
strategy:
max-parallel: 1
matrix:
# see https://github.com/dorny/paths-filter
package: ${{ fromJSON(needs.changes.outputs.packages) }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ jobs:
library(lintr)
lint_package(linters = with_defaults(object_name_linter("camelCase"), line_length_linter(160L), object_length_linter(length = 60L)))
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}
working-directory: ${{ inputs.pkg-path }}

- name: Build archive
run: R CMD build ${{ inputs.pkg-path }}
2 changes: 1 addition & 1 deletion testpkg01/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: testpkg01
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9006
Version: 0.0.0.9007
Authors@R:
person("First", "Last", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "YOUR-ORCID-ID"))
Expand Down
2 changes: 1 addition & 1 deletion testpkg02/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: testpkg02
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9004
Version: 0.0.0.9006
Authors@R:
person("First", "Last", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "YOUR-ORCID-ID"))
Expand Down
1 change: 1 addition & 0 deletions testpkg02/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Generated by roxygen2: do not edit by hand

export(seqRow)
6 changes: 6 additions & 0 deletions testpkg02/R/seqRow.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#' Sequence based on the number of row of a dataframe
#' @param x a dataframe.
#' @export
seqRow <- function(x) {
seq_len(NROW(x))
}
14 changes: 14 additions & 0 deletions testpkg02/man/seqRow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca81fe9

Please sign in to comment.