Skip to content

Commit

Permalink
Update packages in build-check-install workflow + run `staged.depen…
Browse files Browse the repository at this point in the history
…dencies` conditionally (#222)

Signed-off-by: walkowif <[email protected]>
Co-authored-by: cicdguy <[email protected]>
  • Loading branch information
walkowif and cicdguy authored Apr 9, 2024
1 parent bff2101 commit c33dd4c
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ on:
required: false
type: string
default: ""
enable-sd:
description: |
Whether the installation of package dependencies via staged.dependencies should be enabled.
required: false
type: boolean
default: true
update-r-packages:
description: |
Whether R packages installed in the container should be updated to their latest version from CRAN/BioC.
required: false
type: boolean
default: false

concurrency:
group: r-cmd-${{ inputs.concurrency-group }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -296,11 +308,13 @@ jobs:
junit_xml_comparison_input="${{ inputs.junit-xml-comparison }}"
junit_xml_positive_threshold="${{ inputs.junit-xml-positive-threshold }}"
junit_xml_negative_threshold="${{ inputs.junit-xml-negative-threshold }}"
enable_sd="${{ inputs.enable-sd }}"
echo "junit_xml_storage=${junit_xml_storage_input:-_junit_xml_reports}" >> $GITHUB_ENV
echo "junit_xml_diff_branch=${junit_xml_diff_branch_input:-main}" >> $GITHUB_ENV
echo "junit_xml_comparison=${junit_xml_comparison_input:-true}" >> $GITHUB_ENV
echo "junit_xml_positive_threshold=${junit_xml_positive_threshold:-1.0}" >> $GITHUB_ENV
echo "junit_xml_negative_threshold=${junit_xml_negative_threshold:-1.0}" >> $GITHUB_ENV
echo "enable_sd=${enable_sd:-true}" >> $GITHUB_ENV
shell: bash

- name: Restore npm cache 💰
Expand Down Expand Up @@ -338,8 +352,17 @@ jobs:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
path: ~/.staged.dependencies

- name: Update R packages 🗓️
if: >-
inputs.update-r-packages == true
run: |
update.packages()
shell: Rscript {0}

- name: Run Staged dependencies 🎦
if: inputs.install-deps-from-package-repositories == ''
if: >-
env.enable_sd == 'true'
&& inputs.install-deps-from-package-repositories == ''
uses: insightsengineering/staged-dependencies-action@v1
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
Expand Down

0 comments on commit c33dd4c

Please sign in to comment.