From 01f59819b53360f9120c7206f80a48107ede7fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Tue, 27 Feb 2024 15:01:11 +0100 Subject: [PATCH] Add `artifact-name` and `snapshot-artifact-name` for `check-r-package` Closes #800. --- check-r-package/README.md | 8 ++++++++ check-r-package/action.yaml | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/check-r-package/README.md b/check-r-package/README.md index 7bbb7c3ec..1e78a5f44 100644 --- a/check-r-package/README.md +++ b/check-r-package/README.md @@ -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 diff --git a/check-r-package/action.yaml b/check-r-package/action.yaml index 57626d5b5..d2881e309 100644 --- a/check-r-package/action.yaml +++ b/check-r-package/action.yaml @@ -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" @@ -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