diff --git a/.github/workflows/R-CMD-check-hard.yaml b/.github/workflows/R-CMD-check-hard.yaml index edf55fe..776c6f9 100644 --- a/.github/workflows/R-CMD-check-hard.yaml +++ b/.github/workflows/R-CMD-check-hard.yaml @@ -42,6 +42,17 @@ jobs: any::knitr any::rmarkdown + - name: Keep test snapshots in the built package + # By default, testthat fails on CI when a snapshot is missing, and + # .Rbuildignore often leaves tests/testthat/_snaps out of the build. + # This changes only the CI checkout, not the package sent to CRAN. + shell: bash + run: | + if [ -f .Rbuildignore ]; then + sed -i.bak '/_snaps/d' .Rbuildignore + rm .Rbuildignore.bak + fi + - uses: r-lib/actions/check-r-package@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2 with: upload-snapshots: true diff --git a/.github/workflows/R-CMD-check-main.yaml b/.github/workflows/R-CMD-check-main.yaml index b4e82d9..76e767a 100644 --- a/.github/workflows/R-CMD-check-main.yaml +++ b/.github/workflows/R-CMD-check-main.yaml @@ -62,6 +62,17 @@ jobs: } shell: Rscript {0} + - name: Keep test snapshots in the built package + # By default, testthat fails on CI when a snapshot is missing, and + # .Rbuildignore often leaves tests/testthat/_snaps out of the build. + # This changes only the CI checkout, not the package sent to CRAN. + shell: bash + run: | + if [ -f .Rbuildignore ]; then + sed -i.bak '/_snaps/d' .Rbuildignore + rm .Rbuildignore.bak + fi + - uses: r-lib/actions/check-r-package@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2 with: upload-snapshots: true diff --git a/.github/workflows/R-CMD-check-no-oldrel.yaml b/.github/workflows/R-CMD-check-no-oldrel.yaml index c70ceb3..30a77ac 100644 --- a/.github/workflows/R-CMD-check-no-oldrel.yaml +++ b/.github/workflows/R-CMD-check-no-oldrel.yaml @@ -131,6 +131,17 @@ jobs: } shell: Rscript {0} + - name: Keep test snapshots in the built package + # By default, testthat fails on CI when a snapshot is missing, and + # .Rbuildignore often leaves tests/testthat/_snaps out of the build. + # This changes only the CI checkout, not the package sent to CRAN. + shell: bash + run: | + if [ -f .Rbuildignore ]; then + sed -i.bak '/_snaps/d' .Rbuildignore + rm .Rbuildignore.bak + fi + - uses: r-lib/actions/check-r-package@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2 with: upload-snapshots: true diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index a419a3c..8d60bc0 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -138,6 +138,17 @@ jobs: } shell: Rscript {0} + - name: Keep test snapshots in the built package + # By default, testthat fails on CI when a snapshot is missing, and + # .Rbuildignore often leaves tests/testthat/_snaps out of the build. + # This changes only the CI checkout, not the package sent to CRAN. + shell: bash + run: | + if [ -f .Rbuildignore ]; then + sed -i.bak '/_snaps/d' .Rbuildignore + rm .Rbuildignore.bak + fi + - uses: r-lib/actions/check-r-package@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2 with: upload-snapshots: true