diff --git a/.github/workflows/bioccheck.yaml b/.github/workflows/bioccheck.yaml index e86dd696..345226c0 100644 --- a/.github/workflows/bioccheck.yaml +++ b/.github/workflows/bioccheck.yaml @@ -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'. + required: false + type: string + default: "" concurrency: group: bioccheck-${{ github.event.pull_request.number || github.ref }} @@ -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 }} @@ -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: diff --git a/.github/workflows/build-check-install.yaml b/.github/workflows/build-check-install.yaml index edab1673..035e3b64 100644 --- a/.github/workflows/build-check-install.yaml +++ b/.github/workflows/build-check-install.yaml @@ -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: "" @@ -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 @@ -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 💰 @@ -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 }} @@ -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 }} @@ -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: | diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e1b20ab9..b2865c23 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -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 }} @@ -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 }} @@ -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() diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml index 52820098..7fdcb07f 100644 --- a/.github/workflows/rhub.yaml +++ b/.github/workflows/rhub.yaml @@ -100,6 +100,7 @@ jobs: lookup-refs: ${{ inputs.lookup-refs }} skip-install: true github-token: ${{ steps.github-token.outputs.token }} + restore-description: false - uses: r-hub/actions/setup-deps@v1 with: @@ -151,6 +152,7 @@ jobs: lookup-refs: ${{ inputs.lookup-refs }} skip-install: true github-token: ${{ steps.github-token.outputs.token }} + restore-description: false - uses: r-hub/actions/setup-deps@v1 with: diff --git a/.github/workflows/roxygen.yaml b/.github/workflows/roxygen.yaml index e79d4c44..f8295f09 100644 --- a/.github/workflows/roxygen.yaml +++ b/.github/workflows/roxygen.yaml @@ -41,6 +41,21 @@ 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: | + Passed to insightsengineering/setup-r-dependencies. See its documentation. + Used only if deps-installation-method == 'setup-r-dependencies'. + required: false + type: string + default: "" secrets: REPO_GITHUB_TOKEN: description: | @@ -108,13 +123,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 }} @@ -124,6 +149,15 @@ 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 }} + - name: Generate man pages 📄 run: | logfile <- "roxygen_${{ github.event.repository.name }}.log" diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 1a7eda3f..8406b052 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -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: | @@ -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 }} @@ -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() diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml index 655a5fb5..f33b21a2 100644 --- a/.github/workflows/validation.yaml +++ b/.github/workflows/validation.yaml @@ -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: | @@ -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 }} @@ -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: