Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update packages in build-check-install workflow + run staged.dependencies conditionally #222

Merged
merged 10 commits into from
Apr 9, 2024
Merged
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
walkowif marked this conversation as resolved.
Show resolved Hide resolved
run: |
update.packages()
walkowif marked this conversation as resolved.
Show resolved Hide resolved
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
Loading