Skip to content

Commit

Permalink
change check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sorinvoicu committed Mar 13, 2024
1 parent f2e47b6 commit bc042f3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ on:
branches:
- main
workflow_call:
inputs:
dep_path:
description: Path of the dependency file.
required: false
type: string
default: "dependencies.yml"

concurrency:
group: check-test-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -30,17 +36,23 @@ jobs:
- name: Checkout project ⬇️
uses: actions/checkout@v4

- name: Normalize variables 📏
run: |
package_subdirectory_input="${{ inputs.dep_path }}"
echo "dep_path=${dep_path:-'dependencies.yml'}" >> $GITHUB_ENV
shell: bash

- name: Install package dependencies 📄
run: |
if (file.exists("dependencies.yml")) {
repos <- yaml::yaml.load(readLines("dependencies.yml"))$dependencies |>
if (file.exists(${{ env.dep_path }})) {
repos <- yaml::yaml.load(readLines(${{ env.dep_path }}))$dependencies |>
sapply(function(x) x$repo)
if(repos |> length() > 0) {
repos |>
pak::pak(dependencies = TRUE, ask = FALSE, upgrade = FALSE)
}
}
shell: Rscript {0}
shell: Rscript {0}

- name: Check 📦
run: |
Expand Down

0 comments on commit bc042f3

Please sign in to comment.