diff --git a/.github/actions/cran-status-extract/Dockerfile b/.github/actions/cran-status-extract/Dockerfile deleted file mode 100644 index e26ece5d..00000000 --- a/.github/actions/cran-status-extract/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM rocker/tidyverse:4.2.2 - -WORKDIR /app - -# Copy scripts -COPY check-status.R entrypoint.sh /app/ - -# Make the scripts executable -RUN chmod +x /app/* - -# Set entrypoint -ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/.github/actions/cran-status-extract/action.yml b/.github/actions/cran-status-extract/action.yml deleted file mode 100644 index 4b8a05b8..00000000 --- a/.github/actions/cran-status-extract/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CRAN Status Check -description: Creates a summary of issues reported on the CRAN status check page for a given R package - -inputs: - package: - description: | - Package name of the current R package deployed to CRAN - required: true - type: string - statuses: - description: | - Create an issue if one or more of the following - statuses are reported on the check report. - This is a comma-separated string of statuses. - Allowed statuses are 'NOTE', 'WARN', and 'ERROR' - default: 'ERROR' - required: false - type: string - -runs: - using: 'docker' - image: './Dockerfile' - args: - - ${{ inputs.package }} - - ${{ inputs.statuses }} diff --git a/.github/actions/cran-status-extract/check-status.R b/.github/actions/cran-status-extract/check-status.R deleted file mode 100644 index 474bd6ac..00000000 --- a/.github/actions/cran-status-extract/check-status.R +++ /dev/null @@ -1,111 +0,0 @@ -if (!require("optparse")) install.packages("optparse", repos = "https://cloud.r-project.org") -library(dplyr) -library(rvest) -library(stringr) -library(digest) - -# check if needed : package name and working dir path as input arguments : -library(optparse) -option_list <- list( - make_option(c("-p", "--package"), - type = "character", - help = "package name (REQUIRED)", - metavar = "character" - ), - make_option(c("-s", "--statuses"), - type = "character", default = "ERROR,WARN", - help = "status types (comma separated list, for exemple ERROR,WARN,NOTE", - metavar = "character" - ) -) - -opt_parser <- OptionParser(option_list = option_list) -opt <- parse_args(opt_parser) - -parse_errors <- function(url) { - return( - tryCatch(url %>% read_html() %>% html_text(), error = function(e) "URL Not Found") - ) -} - -build_md5_codes <- function(pkg, errors, step) { - # Build current step links - errors[[sprintf("%sLinks", step)]] <- - str_c( - "https://www.r-project.org/nosvn/R.check/", - errors$Flavor, "/", pkg, sprintf("-00%s.html", tolower(step)) - ) - - - # Get details as text for current step - errors[[sprintf("%sDetails", step)]] <- lapply(errors[[sprintf("%sLinks", step)]], - FUN = parse_errors - ) - - # Create md5 codes for each step - errors[[sprintf("%sId", step)]] <- lapply( - errors[[sprintf("%sDetails", step)]], - digest - ) - - # Unlist results - errors[[sprintf("%sId", step)]] <- unlist(errors[[sprintf("%sId", step)]]) - - return(errors) -} - -pkg <- opt$package # paste(desc::desc_get(keys = "Package")) -url <- sprintf("https://cran.r-project.org/web/checks/check_results_%s.html", pkg) - -if (!httr::http_error(url)) { - # Get input status - status_types <- opt$statuses - statuses <- unlist(strsplit(status_types, split = ",")) - - # Parse html table into dataframe - checks <- url %>% - read_html() %>% - html_element("table") %>% - html_table() - - # filter statuses and get their details links (and convert it to md5 unique code) - errors <- filter(checks, Status %in% statuses) - - # If errors table is empty: just get out ! - if (dim(errors)[1] == 0) { - print( - sprintf("None of this status found in the CRAN table. (status=%s)", status_types) - ) - } else { - # Build each step md5 code - errors <- build_md5_codes(pkg, errors, "Build") - errors <- build_md5_codes(pkg, errors, "Check") - errors <- build_md5_codes(pkg, errors, "Install") - - # Alphanumeric order on Flavor (for cran status comparison) - errors <- errors[order(errors$Flavor), ] - - # Save into CSV: - errors %>% - select(Flavor, CheckId, InstallId, BuildId) %>% - write.csv("cran_errors.csv", row.names = FALSE) - cran_status <- function(x) { - cat(x, file = "cran-status.md", append = TRUE, sep = "\n") - } - if (any(checks$Status %in% statuses)) { - cran_status(sprintf( - "CRAN checks for %s resulted in one or more (%s)s:\n\n", - pkg, - status_types - )) - cran_status("\nSee the table below for a summary of the checks run by CRAN:\n\n") - cran_status(knitr::kable(checks)) - cran_status(sprintf( - "\n\nAll details and logs are available here: %s", url - )) - print("❌ One or more CRAN checks resulted in an invalid status ❌") - } - } -} else { - print(paste("ERROR ACCESSING URL=", url)) -} diff --git a/.github/actions/cran-status-extract/entrypoint.sh b/.github/actions/cran-status-extract/entrypoint.sh deleted file mode 100644 index d32c2885..00000000 --- a/.github/actions/cran-status-extract/entrypoint.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -Rscript /app/check-status.R -p "${INPUT_PACKAGE}" -s "${INPUT_STATUSES}" diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 5e155526..76ad589a 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -1,5 +1,25 @@ on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' + push-templates-data: + description: 'Push generated templates data to pharmaverseadam repo' + default: false + required: false + type: boolean + exclude-templates-data: + description: 'List of data generated by templates to exclude (templates script will run, but results will not be push to pharmaverseadam repo) - comma seperated list' + default: '' + required: false + type: string workflow_call: inputs: r-version: @@ -17,16 +37,6 @@ on: default: '' required: false type: string - push: - branches: - - main - - devel - - pre-release - pull_request: - branches: - - main - - devel - - pre-release env: # branch name for PR @@ -58,35 +68,13 @@ concurrency: cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip check_templates]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash - check_templates: name: Verify if: > !contains(github.event.commits[0].message, '[skip check_templates]') runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" - needs: get_r_version - + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index c6a8fff1..d8d59bc1 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -1,5 +1,20 @@ on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' + skip-coverage-badges: + description: 'Skip code coverage badge creation' + default: false + required: false + type: boolean workflow_call: inputs: r-version: @@ -12,16 +27,6 @@ on: default: false required: false type: boolean - push: - branches: - - main - - devel - - pre-release - pull_request: - branches: - - main - - devel - - pre-release name: Code Coverage @@ -30,37 +35,17 @@ concurrency: cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip coverage]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash coverage: name: Test Coverage runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" if: > !contains(github.event.commits[0].message, '[skip coverage]') env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} outputs: coverage-percent: ${{ steps.set-coverage-percentage.outputs.coverage-percentage }} - needs: get_r_version steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names diff --git a/.github/workflows/cran-status.yml b/.github/workflows/cran-status.yml index cbd945db..426c176c 100644 --- a/.github/workflows/cran-status.yml +++ b/.github/workflows/cran-status.yml @@ -3,6 +3,32 @@ name: CRAN Status on: workflow_dispatch: + inputs: + issue-assignees: + description: | + Whom should the issue be assigned to if errors are + encountered in the CRAN status checks? + This is a comma-separated string of GitHub usernames. + If undefined or empty, no assignments are made. + default: '' + required: false + type: string + statuses: + description: | + Create an issue if one or more of the following + statuses are reported on the check report. + This is a comma-separated string of statuses. + Allowed statuses are 'NOTE', 'WARN', and 'ERROR' + default: 'ERROR' + required: false + type: string + path: + description: | + Path to the R package root, if the package is not at the + top level of the repository. + default: '.' + required: false + type: string workflow_call: inputs: issue-assignees: @@ -44,108 +70,9 @@ jobs: container: image: rocker/tidyverse:latest steps: - - name: Checkout repo - uses: actions/checkout@v3 + - name: Run CRAN Status Action + uses: insightsengineering/cran-status-action@v1 with: - fetch-depth: 0 - - - name: Get Date - id: today - run: | - echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - - name: Get current package name - id: current_package - run: | - package_name=$(grep "Package:" DESCRIPTION | awk '{print $NF}') - echo "package_name=$package_name" >> $GITHUB_OUTPUT - - - name: Create orphan branch - id: create_orphan - run: | - git config --global --add safe.directory ${PWD} - git config --global user.email "113703390+pharmaverse-bot@users.noreply.github.com" - git config --global user.name "pharmaverse-bot" - git fetch origin cran_status:cran_status || true - cran_status_branch=$(git branch -a --list cran_status) - # Try to create a new orphan branch if it does not already exist - if [ -z "${cran_status_branch}" ] - then { - echo "🟡 Create cran_status branch" - git checkout --orphan cran_status - mkdir -p /tmp/${{ github.sha }} - cp -r .git /tmp/${{ github.sha }} - cd /tmp/${{ github.sha }} - echo "# CRAN Status" > README.md - git reset - git add --all -f - git commit -m "Initialize orphan cran_status branch" - orphan_exists='false' - git push --set-upstream origin cran_status - } else { - echo "🟢 cran_status branch exists!" - orphan_exists='true' - git checkout - } - fi - echo "orphan_exists=$orphan_exists" >> $GITHUB_OUTPUT - - - name: Compute Cran Status md5 codes - uses: pharmaverse/admiralci/.github/actions/cran-status-extract@main - with: statuses: "${{ inputs.statuses }}" - package: "${{ steps.current_package.outputs.package_name }}" - - - name: Update cran_status branch - id: cran_errors_status - run: | - new_errors=false - cran_status_path="${{ inputs.path }}/cran_errors.csv" - if [ -e ./cran_errors.csv ]; then - current_status_content=$(cat "./cran_errors.csv") - mkdir -p cran_status - # read previous cran status from this branch (ls sort files by alphabetic number) - if [ -z "$(ls -A ./cran_status)" ]; then - # case first writing on the orphan branch (cran_status dir is empty) - last_status_content="FIRST WRITING" - else - last_status_file=$(ls ./cran_status | tail -n 1) - last_status_content=$(cat "./cran_status/$last_status_file") - fi - # check if the status is a new error: - if [ "$current_status_content" != "$last_status_content" ]; then - echo "New errors on the cran status found - package ${{ steps.current_package.outputs.package_name }}" - new_errors=true - cp ./cran_errors.csv "./cran_status/${{ steps.today.outputs.date }}.csv" - else - echo "New errors on the cran status found, but identical to previous ones - package ${{ steps.current_package.outputs.package_name }}" - fi - else - echo "No errors found on the cran status - package ${{ steps.current_package.outputs.package_name }}" - fi - echo "new_errors=$new_errors" >> $GITHUB_OUTPUT - - - name: Report Status - if: ${{ steps.cran_errors_status.outputs.new_errors == 'true' }} - uses: peter-evans/create-issue-from-file@v4 - with: - title: "URGENT! Failed CRAN Checks: ${{ steps.today.outputs.date }}" - content-filepath: ./${{ inputs.path }}/cran-status.md - assignees: ${{ inputs.issue-assignees }} - - - name: Clean Repo and add changes - if: ${{ steps.cran_errors_status.outputs.new_errors == 'true' }} - run: | - rm ./cran_errors.csv 2> /dev/null - rm ./cran-status.md 2> /dev/null - git config --global --add safe.directory ${PWD} - git add "./cran_status/${{ steps.today.outputs.date }}.csv" - - - - name: Commit and push to orphan branch - if: ${{ steps.cran_errors_status.outputs.new_errors == 'true' }} - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: update cran status "${{ steps.today.outputs.date }}" - branch: cran_status - create_branch: false + issue-assignees: "${{ inputs.issue-assignees }}" + path: "${{ inputs.path }}" diff --git a/.github/workflows/lintr.yml b/.github/workflows/lintr.yml index 337502ef..7731bbfc 100644 --- a/.github/workflows/lintr.yml +++ b/.github/workflows/lintr.yml @@ -1,5 +1,20 @@ on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' + lint-all-files: + description: 'Lint all files every time' + default: 'false' + required: false + type: string workflow_call: inputs: r-version: @@ -12,16 +27,6 @@ on: default: 'false' required: false type: string - push: - branches: - - main - - devel - - pre-release - pull_request: - branches: - - main - - devel - - pre-release name: Lint @@ -30,35 +35,15 @@ concurrency: cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip lint]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash lint: name: Lint runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" if: > !contains(github.event.commits[0].message, '[skip lint]') env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - needs: get_r_version steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names diff --git a/.github/workflows/man-pages.yml b/.github/workflows/man-pages.yml index 9cabbf2e..d2356aff 100644 --- a/.github/workflows/man-pages.yml +++ b/.github/workflows/man-pages.yml @@ -1,5 +1,15 @@ on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' workflow_call: inputs: r-version: @@ -7,16 +17,6 @@ on: default: '4.1' required: false type: string - push: - branches: - - main - - devel - - pre-release - pull_request: - branches: - - main - - devel - - pre-release name: Man Pages @@ -25,35 +25,15 @@ concurrency: cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip lint]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash lint: name: Roxygen runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" if: > !contains(github.event.commits[0].message, '[skip lint]') env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - needs: get_r_version steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index accba352..49b347f8 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -1,5 +1,39 @@ on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' + skip-multiversion-docs: + description: 'Skip creation of multi-version docs' + default: false + required: false + type: boolean + multiversion-docs-landing-page: + description: 'Ref to use for the multiversion docs landing page' + default: main + required: false + type: string + latest-tag-alt-name: + description: "An alternate name to use for 'latest-tag' for multiversion pkgdown docs" + default: "" + required: false + type: string + branches-or-tags-to-list: + description: | + Which branches or tags should be listed under the + 'Versions' dropdown menu on the landing page? + This input should be a regular expression in R. + required: false + default: >- + ^main$|^devel$|^pre-release$|^latest-tag$|^cran-release$|^develop$|^v([0-9]+\\.)?([0-9]+\\.)?([0-9]+)$ + type: string workflow_call: inputs: r-version: @@ -31,12 +65,10 @@ on: default: >- ^main$|^devel$|^pre-release$|^latest-tag$|^cran-release$|^develop$|^v([0-9]+\\.)?([0-9]+\\.)?([0-9]+)$ type: string - - push: - branches: - - main - - devel - - pre-release + secrets: + GITHUB_PAT: + required: false + description: GitHub API access token, which might be needed for downstream ops or rendering. name: Documentation @@ -45,35 +77,15 @@ concurrency: cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip docs]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash pkgdown: name: pkgdown runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{ needs.get_r_version.outputs.r-version }}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} if: > !contains(github.event.commits[0].message, '[skip docs]') - needs: get_r_version steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names @@ -141,7 +153,7 @@ jobs: - name: Install package run: renv::install(".", dependencies = "no-deps") shell: Rscript {0} - + - name: Add script to fix rdrr.io links for pharmaverse packages uses: "DamianReeves/write-file-action@v1.2" with: @@ -184,7 +196,7 @@ jobs: invisible() } - + setHook("UserHook::admiralci::tweak_page", tweak_rdrr_url) print("Tweak rdrr.io links for admiral pharmaverse packages.") @@ -231,6 +243,8 @@ jobs: clean = TRUE ) EOF + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} multi-version-docs: name: Multi-version docs diff --git a/.github/workflows/propagate.yml b/.github/workflows/propagate.yml index d9955f1f..3160f9db 100644 --- a/.github/workflows/propagate.yml +++ b/.github/workflows/propagate.yml @@ -52,7 +52,7 @@ jobs: # Run all steps in this job for the following repositories. repos: - name: admiralonco - target-branch: devel + target-branch: main reviewers: |- bundfussr cicdguy @@ -68,7 +68,7 @@ jobs: cicdguy bundfussr - name: admiralophtha - target-branch: devel + target-branch: main reviewers: |- cicdguy - name: admiral @@ -78,12 +78,12 @@ jobs: bms63 bundfussr - name: pharmaversesdtm - target-branch: devel + target-branch: main reviewers: |- bms63 bundfussr - name: admiralvaccine - target-branch: devel + target-branch: main reviewers: |- bms63 steps: diff --git a/.github/workflows/r-pkg-validation.yml b/.github/workflows/r-pkg-validation.yml index aa7dd117..e3ab9c56 100644 --- a/.github/workflows/r-pkg-validation.yml +++ b/.github/workflows/r-pkg-validation.yml @@ -2,6 +2,16 @@ name: R Package Validation report on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' workflow_call: inputs: r-version: @@ -13,28 +23,11 @@ on: types: [published] jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash r-pkg-validation: name: Generate runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" # Set Github token permissions env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -43,7 +36,6 @@ jobs: contents: write packages: write deployments: write - needs: get_r_version steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names diff --git a/.github/workflows/readme-render.yml b/.github/workflows/readme-render.yml index 4030db61..2d33411c 100644 --- a/.github/workflows/readme-render.yml +++ b/.github/workflows/readme-render.yml @@ -1,14 +1,22 @@ name: Render README on: - push: - branches: - - main - - devel - - pre-release - paths: - - README.Rmd workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' + skip-md-formatting: + description: 'Skip markdown auto-formatting' + default: false + required: false + type: boolean workflow_call: inputs: r-version: @@ -24,31 +32,13 @@ on: jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash render: name: Render runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - needs: get_r_version steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 06a22894..9035606d 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -3,6 +3,21 @@ name: Spelling on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' + exclude: + description: 'List of paths to exclude (comma seperated list)' + default: '' + required: false + type: string workflow_call: inputs: r-version: @@ -15,53 +30,21 @@ on: default: '' required: false type: string - push: - branches: - - main - - devel - - pre-release - pull_request: - branches: - - main - - devel - - pre-release concurrency: group: spelling-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip spellcheck]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash - roxygen: name: Spellcheck runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} if: > !contains(github.event.commits[0].message, '[skip spellcheck]') - needs: get_r_version - steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index a87fd7a6..7f74f0d9 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -3,6 +3,16 @@ name: Style on: workflow_dispatch: + inputs: + r-version: + description: 'The version of R to use' + default: '4.1' + required: false + type: choice + options: + - '4.1' + - '4.2' + - '4.3' workflow_call: inputs: r-version: @@ -10,50 +20,19 @@ on: default: '4.1' required: false type: string - push: - branches: - - main - - devel - - pre-release - pull_request: - branches: - - main - - devel - - pre-release concurrency: group: style-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - get_r_version: - name: Get R version - runs-on: ubuntu-latest - if: > - !contains(github.event.commits[0].message, '[skip style]') - outputs: - r-version: ${{ steps.normalizer.outputs.R_VERSION }} - steps: - - name: Normalize inputs - id: normalizer - run: | - R_VERSION="${{ inputs.r-version }}" - if [ "$R_VERSION" == "" ] - then { - R_VERSION="4.1" - } - fi - echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT - shell: bash style: name: Code Style runs-on: ubuntu-latest container: - image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest" + image: "ghcr.io/pharmaverse/admiralci-${{ inputs.r-version }}:latest" if: > !contains(github.event.commits[0].message, '[skip style]') - needs: get_r_version - steps: ##################### BEGIN boilerplate steps ##################### - name: Get branch names