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

feat: add an option to choose between staged-dependencies and setup-r-dependencies #252

Merged
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1aad0ff
feat: add an option to choose between staged-dependencies and setup-r…
walkowif Sep 9, 2024
28e5ada
Merge branch 'main' into choose-between-staged-dependencies-and-setup…
walkowif Sep 9, 2024
04ad6fc
fix: deps-installation-method input
walkowif Sep 9, 2024
84bb90b
fix: add type to lookup-refs input
walkowif Sep 9, 2024
5a9b4b0
fix: step condition
walkowif Sep 9, 2024
66aae70
fix: set repository-path for setup-r-dependencies
walkowif Sep 9, 2024
72d8019
fix: update repository-path input
walkowif Sep 9, 2024
df1961e
chore: test fix_paths branch of setup-r-dependencies
walkowif Sep 9, 2024
2d467d7
fix: restore DESCRIPTION modified by Roxygen
walkowif Sep 9, 2024
e5b303c
fix: set working directory in Roxygen workflow
walkowif Sep 9, 2024
7523215
fix: normalize variables
walkowif Sep 10, 2024
d839700
fix: add package subdirectory to repository-path input
walkowif Sep 10, 2024
a881fa7
fix: restore repository-path
walkowif Sep 10, 2024
04a5cc1
chore: set setup-r-dependencies to v1
walkowif Sep 10, 2024
b6b6649
chore: test with rocker image
walkowif Sep 12, 2024
eaaa1fe
chore: set custom binary repositories
walkowif Sep 12, 2024
26fd3ef
chore: test without custom repos
walkowif Sep 12, 2024
e75aee5
chore: switch to set-custom-repositories branch
walkowif Sep 12, 2024
4b8abdf
chore: restore setup-r-dependencies version after testing
walkowif Sep 12, 2024
2098b52
Revert "chore: restore setup-r-dependencies version after testing"
walkowif Sep 12, 2024
667134d
Revert "Revert "chore: restore setup-r-dependencies version after tes…
walkowif Sep 12, 2024
4657c32
chore: test binary dependencies
walkowif Sep 23, 2024
56ed640
Revert "chore: test binary dependencies"
walkowif Sep 23, 2024
171e39c
Revert "Revert "chore: test binary dependencies""
walkowif Sep 23, 2024
5568575
Revert "Revert "Revert "chore: test binary dependencies"""
walkowif Sep 23, 2024
67f8871
chore: use setup-r-dependencies@setup-binary-package-repository-for-d…
walkowif Sep 24, 2024
e178a40
Revert "chore: use setup-r-dependencies@setup-binary-package-reposito…
walkowif Sep 26, 2024
6d6d8f7
docs: update lookup-refs input description
walkowif Sep 26, 2024
f5bf0cf
fix: don't restore DESCRIPTION in roxygen workflow
walkowif Sep 26, 2024
be437d5
chore: use insightsengineering/setup-r-dependencies@fix/copy-and-rest…
walkowif Sep 26, 2024
49c69c0
chore: use insightsengineering/setup-r-dependencies@fix/copy-and-rest…
walkowif Sep 26, 2024
bbaf1eb
chore: restore insightsengineering/setup-r-dependencies@v1
walkowif Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/bioccheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ on:
required: false
type: string
default: "."
deps-installation-method:
description: |
Which method for installing R package dependencies to use? Supported values are:
staged-dependencies
setup-r-dependencies
required: false
type: string
default: staged-dependencies
lookup-refs:
description: |
List of package references to be used by setup-r-dependencies action if deps-installation-method == 'setup-r-dependencies'.
walkowif marked this conversation as resolved.
Show resolved Hide resolved
required: false
type: string
default: ""

concurrency:
group: bioccheck-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -122,12 +136,16 @@ jobs:
SKIP_INSTRUCTION: "[skip bioccheck]"

- name: Restore SD cache 💰
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: actions/cache@v4
with:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
path: ~/.staged.dependencies

- name: Run Staged dependencies 🎦
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: insightsengineering/staged-dependencies-action@v2
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
Expand All @@ -137,6 +155,15 @@ jobs:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
direction: ${{ inputs.sd-direction }}

- name: Setup R dependencies 🎦
if: >-
inputs.deps-installation-method == 'setup-r-dependencies'
uses: insightsengineering/setup-r-dependencies@v1
with:
lookup-refs: ${{ inputs.lookup-refs }}
github-token: ${{ steps.github-token.outputs.token }}
repository-path: ${{ github.event.repository.name }}

- name: Run BiocCheck ☣️
uses: insightsengineering/bioc-check-action@v1
with:
Expand Down
34 changes: 33 additions & 1 deletion .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ on:
description: |
Set this to a comma-separated named list of R packages repositories to use for installing dependencies.
Example: "R-universe=https://insightsengineering.r-universe.dev/,CRAN=https://cloud.r-project.org/"
If the value is non-empty, it takes precedence over deps-installation-method.
required: false
type: string
default: ""
deps-installation-method:
description: |
Which method for installing R package dependencies to use? Supported values are:
staged-dependencies
setup-r-dependencies
required: false
type: string
default: staged-dependencies
lookup-refs:
description: |
List of package references to be used by setup-r-dependencies action if deps-installation-method == 'setup-r-dependencies'.
required: false
type: string
default: ""
Expand Down Expand Up @@ -177,6 +192,8 @@ on:
enable-sd:
description: |
Whether the installation of package dependencies via staged.dependencies should be enabled.
Has no effect if deps-installation-method == 'setup-r-dependencies' or
install-deps-from-package-repositories is set to non-empty value.
required: false
type: boolean
default: true
Expand Down Expand Up @@ -319,12 +336,14 @@ jobs:
junit_xml_positive_threshold="${{ inputs.junit-xml-positive-threshold }}"
junit_xml_negative_threshold="${{ inputs.junit-xml-negative-threshold }}"
enable_sd="${{ inputs.enable-sd }}"
deps_installation_method="${{ inputs.deps-installation-method }}"
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
echo "deps_installation_method=${deps_installation_method:-staged-dependencies}" >> $GITHUB_ENV
shell: bash

- name: Restore npm cache 💰
Expand Down Expand Up @@ -356,7 +375,9 @@ jobs:
shell: bash

- name: Restore SD cache 💰
if: inputs.install-deps-from-package-repositories == ''
if: >-
inputs.install-deps-from-package-repositories == ''
&& env.deps_installation_method == 'staged-dependencies'
uses: actions/cache@v4
with:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
Expand All @@ -373,6 +394,7 @@ jobs:
if: >-
env.enable_sd == 'true'
&& inputs.install-deps-from-package-repositories == ''
&& env.deps_installation_method == 'staged-dependencies'
uses: insightsengineering/staged-dependencies-action@v2
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
Expand All @@ -382,6 +404,16 @@ jobs:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
direction: ${{ inputs.sd-direction }}

- name: Setup R dependencies 🎦
if: >-
env.deps_installation_method == 'setup-r-dependencies'
&& inputs.install-deps-from-package-repositories == ''
uses: insightsengineering/setup-r-dependencies@v1
with:
lookup-refs: ${{ inputs.lookup-refs }}
github-token: ${{ steps.github-token.outputs.token }}
repository-path: ${{ github.event.repository.name }}

- name: Install dependencies from package repositories 🗄️
if: inputs.install-deps-from-package-repositories != ''
run: |
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ on:
required: false
type: string
default: ""
deps-installation-method:
description: |
Which method for installing R package dependencies to use? Supported values are:
staged-dependencies
setup-r-dependencies
required: false
type: string
default: staged-dependencies
lookup-refs:
description: |
List of package references to be used by setup-r-dependencies action if deps-installation-method == 'setup-r-dependencies'.
required: false
type: string
default: ""

concurrency:
group: docs-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -194,12 +208,16 @@ jobs:
SKIP_INSTRUCTION: "[skip docs]"

- name: Restore SD cache 💰
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: actions/cache@v4
with:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
path: ~/.staged.dependencies

- name: Run Staged dependencies 🎦
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: insightsengineering/staged-dependencies-action@v2
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
Expand All @@ -209,6 +227,15 @@ jobs:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
direction: ${{ inputs.sd-direction }}

- name: Setup R dependencies 🎦
if: >-
inputs.deps-installation-method == 'setup-r-dependencies'
uses: insightsengineering/setup-r-dependencies@v1
with:
lookup-refs: ${{ inputs.lookup-refs }}
github-token: ${{ steps.github-token.outputs.token }}
repository-path: ${{ github.event.repository.name }}

- name: Install R package 🚧
run: |
if (file.exists("renv.lock")) renv::restore()
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/roxygen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ on:
required: false
type: string
default: "."
deps-installation-method:
description: |
Which method for installing R package dependencies to use? Supported values are:
staged-dependencies
setup-r-dependencies
required: false
type: string
default: staged-dependencies
lookup-refs:
description: |
List of package references to be used by setup-r-dependencies action if deps-installation-method == 'setup-r-dependencies'.
required: false
type: string
default: ""
secrets:
REPO_GITHUB_TOKEN:
description: |
Expand Down Expand Up @@ -108,13 +122,23 @@ jobs:
env:
SKIP_INSTRUCTION: "[skip roxygen]"

- name: Normalize variables 📏
run: |
deps_installation_method="${{ inputs.deps-installation-method }}"
echo "deps_installation_method=${deps_installation_method:-staged-dependencies}" >> $GITHUB_ENV
shell: bash

- name: Restore SD cache 💰
if: >-
env.deps_installation_method == 'staged-dependencies'
uses: actions/cache@v4
with:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
path: ~/.staged.dependencies

- name: Run Staged dependencies 🎦
if: >-
env.deps_installation_method == 'staged-dependencies'
uses: insightsengineering/staged-dependencies-action@v2
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
Expand All @@ -124,6 +148,22 @@ jobs:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
direction: ${{ inputs.sd-direction }}

- name: Setup R dependencies 🎦
if: >-
env.deps_installation_method == 'setup-r-dependencies'
uses: insightsengineering/setup-r-dependencies@v1
with:
lookup-refs: ${{ inputs.lookup-refs }}
github-token: ${{ steps.github-token.outputs.token }}
repository-path: ${{ github.event.repository.name }}

# setup-r-dependencies makes modifications to DESCRIPTION which
# should not be committed during Roxygen auto-update.
- name: Restore DESCRIPTION ⚙️
run: git restore DESCRIPTION
working-directory: ${{ github.event.repository.name }}
shell: bash
pawelru marked this conversation as resolved.
Show resolved Hide resolved

- name: Generate man pages 📄
run: |
logfile <- "roxygen_${{ github.event.repository.name }}.log"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ on:
required: false
type: string
default: ""
deps-installation-method:
description: |
Which method for installing R package dependencies to use? Supported values are:
staged-dependencies
setup-r-dependencies
required: false
type: string
default: staged-dependencies
lookup-refs:
description: |
List of package references to be used by setup-r-dependencies action if deps-installation-method == 'setup-r-dependencies'.
required: false
type: string
default: ""
secrets:
REPO_GITHUB_TOKEN:
description: |
Expand Down Expand Up @@ -207,12 +221,16 @@ jobs:
fi

- name: Restore SD cache 💰
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: actions/cache@v4
with:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
path: ~/.staged.dependencies

- name: Run Staged dependencies 🎦
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: insightsengineering/staged-dependencies-action@v2
env:
GITHUB_PAT: ${{ secrets.REPO_GITHUB_TOKEN }}
Expand All @@ -222,6 +240,15 @@ jobs:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
direction: ${{ inputs.sd-direction }}

- name: Setup R dependencies 🎦
if: >-
inputs.deps-installation-method == 'setup-r-dependencies'
uses: insightsengineering/setup-r-dependencies@v1
with:
lookup-refs: ${{ inputs.lookup-refs }}
github-token: ${{ steps.github-token.outputs.token }}
repository-path: ${{ github.event.repository.name }}

- name: Install R package 🚧
run: |
if (file.exists("renv.lock")) renv::restore()
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ on:
required: false
type: string
default: "."
deps-installation-method:
description: |
Which method for installing R package dependencies to use? Supported values are:
staged-dependencies
setup-r-dependencies
required: false
type: string
default: staged-dependencies
lookup-refs:
description: |
List of package references to be used by setup-r-dependencies action if deps-installation-method == 'setup-r-dependencies'.
required: false
type: string
default: ""
secrets:
REPO_GITHUB_TOKEN:
description: |
Expand Down Expand Up @@ -111,12 +125,16 @@ jobs:
shell: bash

- name: Restore SD cache 💰
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: actions/cache@v4
with:
key: sd-${{ runner.os }}-${{ github.event.repository.name }}
path: ~/.staged.dependencies

- name: Run Staged dependencies 🎦
if: >-
inputs.deps-installation-method == 'staged-dependencies'
uses: insightsengineering/staged-dependencies-action@v2
env:
GITHUB_PAT: ${{ steps.github-token.outputs.token }}
Expand All @@ -126,6 +144,15 @@ jobs:
run-system-dependencies: ${{ inputs.install-system-dependencies }}
direction: ${{ inputs.sd-direction }}

- name: Setup R dependencies 🎦
if: >-
inputs.deps-installation-method == 'setup-r-dependencies'
uses: insightsengineering/setup-r-dependencies@v1
with:
lookup-refs: ${{ inputs.lookup-refs }}
github-token: ${{ steps.github-token.outputs.token }}
repository-path: ${{ env.package_subdirectory }}

- name: Build report 🏗
uses: insightsengineering/thevalidatoR@v2
env:
Expand Down
Loading