From 7ecd29da35ed8abc54450c4e26c84d8f80d69203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Mon, 19 Feb 2024 12:45:30 +0100 Subject: [PATCH] feat(update-lockfile): Use pak instead of renv --- .../{update-renv.yaml => update-lockfile.yaml} | 10 +++++----- .github/workflows/workflow-dispatcher.yaml | 6 +++--- workflows/README.md | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) rename .github/workflows/{update-renv.yaml => update-lockfile.yaml} (81%) diff --git a/.github/workflows/update-renv.yaml b/.github/workflows/update-lockfile.yaml similarity index 81% rename from .github/workflows/update-renv.yaml rename to .github/workflows/update-lockfile.yaml index 55a3a133..4383e94e 100644 --- a/.github/workflows/update-renv.yaml +++ b/.github/workflows/update-lockfile.yaml @@ -12,7 +12,7 @@ on: required: true jobs: - update-renv: + update-lockfile: name: 🛠️ Store dependency versions if: ${{ inputs.run }} runs-on: ubuntu-latest @@ -29,10 +29,10 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: cache-version: ${{ inputs.cache_version }} - extra-packages: any::renv + extra-packages: any::pak - - name: Update the renv.lock file - run: renv::snapshot(prompt = FALSE) + - name: Update the pkg.lock file + run: pak::lockfile_create(".") shell: Rscript {0} - name: Commit and push changes @@ -41,5 +41,5 @@ jobs: git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" git switch ${{ inputs.branch_name }} git add man/\* NAMESPACE DESCRIPTION - git commit -m "chore: update renv.lock" || echo "No changes to commit" + git commit -m "chore: update pkg.lock" || echo "No changes to commit" git push diff --git a/.github/workflows/workflow-dispatcher.yaml b/.github/workflows/workflow-dispatcher.yaml index d9f8378d..8e8de17a 100644 --- a/.github/workflows/workflow-dispatcher.yaml +++ b/.github/workflows/workflow-dispatcher.yaml @@ -221,12 +221,12 @@ jobs: group: pkgdown-${{ needs.trigger.outputs.branch_name }} cancel-in-progress: true - update-renv: + update-lockfile: needs: trigger - uses: ./.github/workflows/update-renv.yaml + uses: ./.github/workflows/update-lockfile.yaml with: cache_version: ${{ needs.trigger.outputs.cache_version }} - run: ${{ !contains(inputs.skip, 'update-renv') && ( + run: ${{ !contains(inputs.skip, 'update-lockfile') && ( inputs.event_name == 'workflow_dispatch' || ( needs.trigger.outputs.main_branch_affected == 'true' && ( needs.trigger.outputs.R_files_changed == 'true' || diff --git a/workflows/README.md b/workflows/README.md index 45c5c196..346a2491 100644 --- a/workflows/README.md +++ b/workflows/README.md @@ -159,16 +159,16 @@ Click on the workflow and look for the "Run Spelling Check test" tab to see the If any spelling mistakes are found, the workflow will give an error. -## update-renv.yaml +## update-lockfile.yaml #### Trigger Pushes or pull requests to the main branch if there are changes to the `DESCRIPTION`, or any file in the `R/` or `tests/` folders. #### Function -Runs `renv::snapshot()` on the code base and commits results. +Runs `pak::lockfile_create()` on the code base and commits results. #### Outcome -The function will update the `renv.lock` file of the repository match the testing environment. +The function will update the `pkg.lock` file of the repository match the testing environment. > [!IMPORTANT] > To use this workflow, you need to have configure GitHub