Skip to content

Commit

Permalink
feat(update-lockfile): Use pak instead of renv
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Feb 19, 2024
1 parent 6fbaf62 commit 7ecd29d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
required: true

jobs:
update-renv:
update-lockfile:
name: 🛠️ Store dependency versions
if: ${{ inputs.run }}
runs-on: ubuntu-latest
Expand All @@ -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
Expand All @@ -41,5 +41,5 @@ jobs:
git config --local user.email "[email protected]"
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
6 changes: 3 additions & 3 deletions .github/workflows/workflow-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' ||
Expand Down
6 changes: 3 additions & 3 deletions workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ecd29d

Please sign in to comment.