Skip to content

Commit

Permalink
Add artifact-name and snapshot-artifact-name for check-r-package
Browse files Browse the repository at this point in the history
Closes #800.
  • Loading branch information
gaborcsardi committed Feb 27, 2024
1 parent 0cb0735 commit 01f5981
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions check-r-package/README.md
Expand Up @@ -25,6 +25,14 @@ Inputs available:
successful runs too.
- working-directory - default `"."`. If the R package to check is not in
the root directory of your repository.
- artifact-name - Use this to override the default artifact name for the
check results. The default is `{os}-{arch}-r{rversion}-{id}-result`, where
`{id}` is `matrix.config.id` or `strategy.job-index` if the former is
not defined.
- snapshot-artifact-name: Use this to override the default artifact name
for testthat snapshots. The default is
`{os}-{arch}-r{rversion}-{id}-testthat-snapsots`, where `{id}` is
`matrix.config.id` or `strategy.job-index` if the former is not defined.

Basic:
```yaml
Expand Down
10 changes: 8 additions & 2 deletions check-r-package/action.yaml
Expand Up @@ -23,6 +23,12 @@ inputs:
upload-results:
description: 'Whether to upload check results for successful runs too.'
default: false
artifact-name:
description: |
Use this to override the default artifact name for the check results.
snapshot-artifact-name:
description: |
Use this to override the default artifact name for testthat snapshots.
runs:
using: "composite"
Expand Down Expand Up @@ -54,13 +60,13 @@ runs:
if: failure() || inputs.upload-results != 'false'
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-r${{ matrix.config.r }}-${{ matrix.config.id || strategy.job-index }}-results
name: ${{ artifact-name || format('{0}-{1}-r{2}-{3}-results', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }}
path: ${{ steps.rcmdcheck.outputs.check-dir-path }}

- name: Upload snapshots
if: inputs.upload-snapshots != 'false'
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-r${{ matrix.config.r }}-${{ matrix.config.id || strategy.job-index }}-testthat-snapshots
name: ${{ snapshot-artifact-name || format('{0}-{1}-r{2}-{3}-testthat-snapshots', runner.os, runner.arch, matrix.config.r, matrix.config.id || strategy.job-index ) }}
path: ${{ steps.rcmdcheck.outputs.check-dir-path }}/**/tests*/testthat/_snaps
if-no-files-found: ignore

0 comments on commit 01f5981

Please sign in to comment.