diff --git a/.Rbuildignore b/.Rbuildignore index 09e2574b8..61b7724ec 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,5 @@ ^docs/*$ ^testthat-problems.rds$ ^testthat.Rout.fail$ +^renv/sandbox$ + diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9933289e6..f8bf2986f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -91,7 +91,7 @@ jobs: if: runner.os != 'Windows' run: | renv::init() - system('rm -rf renv .Rprofile') + system('rm -rf renv.lock renv .Rprofile') system('git clean -fd -e .github') system('git restore .') shell: Rscript {0} diff --git a/.gitignore b/.gitignore index f610ccbea..67bb557c8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ inst/doc docs/ *.fail testthat-problems.* +renv/sandbox/* diff --git a/DESCRIPTION b/DESCRIPTION index 104a32e30..dbe913726 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sandpaper Title: Create and Curate Carpentries Lessons -Version: 0.10.1 +Version: 0.10.2 Authors@R: c( person(given = "Zhian N.", family = "Kamvar", diff --git a/NEWS.md b/NEWS.md index d39c6ec3f..988f62897 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,18 @@ +# sandpaper 0.10.2 + +BUG FIX +------- + +* The default `.gitignore` now has `renv/sandbox` to avoid a sandbox directory + from being tracked by git. (see https://github.com/rstudio/renv/issues/1088) + +CONTINUOUS INTEGRATION +---------------------- + +* The `deploy-aws.yaml` workflow has been removed as plans for its use is + relegated to the beta stage of the workbench. + + # sandpaper 0.10.1 NEW FEATURES diff --git a/inst/templates/gitignore-template.txt b/inst/templates/gitignore-template.txt index bd8745489..0aa545923 100644 --- a/inst/templates/gitignore-template.txt +++ b/inst/templates/gitignore-template.txt @@ -49,3 +49,5 @@ docs/ # translation temp files po/*~ +# renv sandbox +renv/sandbox diff --git a/inst/workflows/README.md b/inst/workflows/README.md index a29715dc2..cc4a94de4 100644 --- a/inst/workflows/README.md +++ b/inst/workflows/README.md @@ -49,16 +49,6 @@ the `renv.lock` file, respectively. If there is a problem with the cache, manual invaliation is necessary and can be done by setting the `CACHE_VERSION` secret to the current date. -### Deploy to AWS (deploy-aws.yaml) - -If you have an AWS bucket that is set up to deploy the site from a folder, this -workflow will deploy the site to that folder after `01 Build and Deploy` runs. -It can also be triggered manually. - -Note: for this to work, you must have the `AWS_S3_BUCKET`, `AWS_ACCESS_KEY_ID`, -and `AWS_SECRET_ACCESS_KEY` in your repository secrets. If any of these are -missing, the workflow will not run. - ## Updates ### Setup Information diff --git a/inst/workflows/deploy-aws.yaml b/inst/workflows/deploy-aws.yaml deleted file mode 100644 index d154a7da0..000000000 --- a/inst/workflows/deploy-aws.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Deploy to AWS" - -on: - workflow_run: - workflows: ["01 Build and Deploy Site"] - types: - - completed - workflow_dispatch: - -jobs: - preflight: - name: "Preflight Check" - runs-on: ubuntu-latest - outputs: - ok: ${{ steps.check.outputs.ok }} - folder: ${{ steps.check.outputs.folder }} - steps: - - id: check - run: | - if [[ -z "${{ secrets.AWS_S3_BUCKET }}" || -z "${{ secrets.AWS_ACCESS_KEY_ID }}" || -z "${{ secrets.AWS_SECRET_ACCESS_KEY }}" ]]; then - echo ":information_source: No site configured" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "To deploy on AWS, you need the `AWS_S3_BUCKET`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY` secrets set up" >> $GITHUB_STEP_SUMMARY - else - echo "::set-output name=folder::"$(sed -E 's^.+/(.+)^\1^' <<< ${{ github.repository }}) - echo "::set-output name=ok::true" - fi - - full-build: - name: "Deploy to AWS" - needs: [preflight] - if: ${{ needs.preflight.outputs.ok }} - runs-on: ubuntu-latest - steps: - - - name: "Checkout site folder" - uses: actions/checkout@v3 - with: - ref: 'gh-pages' - path: 'source' - - - name: "Deploy to Bucket" - uses: jakejarvis/s3-sync-action@v0.5.1 - with: - args: --acl public-read --follow-symlinks --delete --exclude '.git/*' - env: - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - SOURCE_DIR: 'source' - DEST_DIR: ${{ needs.preflight.outputs.folder }} - - - name: "Invalidate CloudFront" - uses: chetan/invalidate-cloudfront-action@master - env: - PATHS: /* - AWS_REGION: 'us-east-1' - DISTRIBUTION: ${{ secrets.DISTRIBUTION }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/tests/testthat/_snaps/create_lesson.md b/tests/testthat/_snaps/create_lesson.md index cb2d54b31..90a0cd05a 100644 --- a/tests/testthat/_snaps/create_lesson.md +++ b/tests/testthat/_snaps/create_lesson.md @@ -25,6 +25,7 @@ .Renviron docs/ po/*~ + renv/sandbox # Destruction of the .gitignore file renders the lesson incorrect [ansi] @@ -53,6 +54,7 @@ .Renviron docs/ po/*~ + renv/sandbox # Destruction of the .gitignore file renders the lesson incorrect [unicode] @@ -81,6 +83,7 @@ .Renviron docs/ po/*~ + renv/sandbox # Destruction of the .gitignore file renders the lesson incorrect [fancy] @@ -109,4 +112,5 @@ .Renviron docs/ po/*~ + renv/sandbox diff --git a/tests/testthat/test-manage_deps.R b/tests/testthat/test-manage_deps.R index 38ec74c7d..f82a60f81 100644 --- a/tests/testthat/test-manage_deps.R +++ b/tests/testthat/test-manage_deps.R @@ -44,10 +44,14 @@ test_that("manage_deps() will create a renv folder", { skip_on_cran() skip_on_os("windows") rnv <- fs::path(lsn, "renv") - fs::file_move(rnv, fs::path(lsn, "vner")) + # need to move renv folder outside of the lesson or it will detect the + # suggested packages within the package and chaos will ensue + tmp <- withr::local_tempfile() + fs::dir_create(tmp) + fs::file_move(rnv, tmp) withr::defer({ fs::dir_delete(rnv) - fs::file_move(fs::path(lsn, "vner"), rnv) + fs::file_move(fs::path(tmp, "renv"), rnv) }) expect_false(fs::dir_exists(rnv))