diff --git a/.github/workflows/R-CMD-check-all.yaml b/.github/workflows/R-CMD-check-all.yaml index a0a0172..8efb4ef 100644 --- a/.github/workflows/R-CMD-check-all.yaml +++ b/.github/workflows/R-CMD-check-all.yaml @@ -5,6 +5,8 @@ on: pull_request: branches: [main, master] +name: R-CMD-check-all + jobs: changes: runs-on: ubuntu-latest @@ -15,24 +17,24 @@ jobs: packages: ${{ steps.filter.outputs.changes }} steps: # For pull requests it's not necessary to checkout the code + - uses: actions/checkout@v2 - uses: dorny/paths-filter@v2 id: filter with: filters: | - testpkg01: testpkg01 - testpkg02: testpkg02 + testpkg01: 'testpkg01/**' + testpkg02: 'testpkg02/**' - # JOB to build and test each of modified packages - build: - needs: changes - secrets: inherit - strategy: - matrix: - # Parse JSON array containing names of all filters matching any of changed files - # e.g. ['package1', 'package2'] if both package folders contains changes - package: ${{ fromJSON(needs.changes.outputs.packages) }} - runs-on: ubuntu-20.04 - steps: - - uses: ./.github/workflows/R-CMD-check.yaml - with: - pkg-path: ${{ matrix.package }} + # JOB to build and test each of modified packages + build: + needs: changes + # https://github.com/dorny/paths-filter/issues/66 + if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} + strategy: + matrix: + # see https://github.com/dorny/paths-filter + package: ${{ fromJSON(needs.changes.outputs.packages) }} + uses: ./.github/workflows/R-CMD-check.yaml + secrets: inherit + with: + pkg-path: ${{ matrix.package }} diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 260398e..f7ac095 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -10,26 +10,24 @@ name: R-CMD-check jobs: R-CMD-check: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - uses: actions/checkout@v2 - working-directory: ${{ inputs.pkg-path }} - - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - working-directory: ${{ inputs.pkg-path }} - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: [cover, goodpractice, rcmdcheck, lintr] - working-directory: ${{ inputs.pkg-path }} + extra-packages: rcmdcheck, any::covr, any::goodpractice, any::lintr + working-directory: ${{ inputs.pkg-path }} - uses: r-lib/actions/check-r-package@v2 - working-directory: ${{ inputs.pkg-path }} + with: + working-directory: ${{ inputs.pkg-path }} - name: Code coverage run: covr::package_coverage() diff --git a/testpkg01/DESCRIPTION b/testpkg01/DESCRIPTION index bdc943f..fea93a7 100644 --- a/testpkg01/DESCRIPTION +++ b/testpkg01/DESCRIPTION @@ -1,6 +1,6 @@ Package: testpkg01 Title: What the Package Does (One Line, Title Case) -Version: 0.0.0.9001 +Version: 0.0.0.9006 Authors@R: person("First", "Last", , "first.last@example.com", role = c("aut", "cre"), comment = c(ORCID = "YOUR-ORCID-ID")) diff --git a/testpkg01/NAMESPACE b/testpkg01/NAMESPACE index 6ae9268..01843dc 100644 --- a/testpkg01/NAMESPACE +++ b/testpkg01/NAMESPACE @@ -1,2 +1,3 @@ # Generated by roxygen2: do not edit by hand +export(hello) diff --git a/testpkg01/R/hello.R b/testpkg01/R/hello.R new file mode 100644 index 0000000..db5044e --- /dev/null +++ b/testpkg01/R/hello.R @@ -0,0 +1,5 @@ +#' Hello world +#' @export +hello <- function() { + "Hello World 2!" +} \ No newline at end of file diff --git a/testpkg01/man/hello.Rd b/testpkg01/man/hello.Rd new file mode 100644 index 0000000..3c9d2ff --- /dev/null +++ b/testpkg01/man/hello.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hello.R +\name{hello} +\alias{hello} +\title{Hello world} +\usage{ +hello() +} +\description{ +Hello world +} diff --git a/testpkg02/DESCRIPTION b/testpkg02/DESCRIPTION index 5078aac..16091f5 100644 --- a/testpkg02/DESCRIPTION +++ b/testpkg02/DESCRIPTION @@ -1,6 +1,6 @@ Package: testpkg02 Title: What the Package Does (One Line, Title Case) -Version: 0.0.0.9000 +Version: 0.0.0.9004 Authors@R: person("First", "Last", , "first.last@example.com", role = c("aut", "cre"), comment = c(ORCID = "YOUR-ORCID-ID"))