From 1bf5f11ad4efe7f5c087f9bc08f6f3ca4b975326 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:45:02 +0200 Subject: [PATCH 01/39] add checks for devel --- .github/workflows/push-docker-image.yml | 28 +++++++++++++++++++++---- .github/workflows/r-cmd-check.yml | 27 ++++++++++++++++-------- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index d85cb83c..107ba4e6 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -47,6 +47,7 @@ jobs: renv_list="${{ steps.changed-files.outputs.all_changed_files }}" fi renv_list=$(echo $renv_list | sed 's/ /", "/g') + renv_list="$renv_list devel" # adding devel conf echo "renv=[\"$renv_list\"]" >> $GITHUB_OUTPUT deploy-image: @@ -76,14 +77,20 @@ jobs: id: image_specs run: | package_name=$(grep "Package:" DESCRIPTION | awk '{print $NF}') - r_version=$(basename $(dirname ${{ matrix.value }})) # TODO: check here if legacy renv (if yes, delete _legacy suffix and add _legacy suffix to docker im?) + if [ "${{ matrix.value }}" == "devel" ]{ + r_version="devel" + } + else { + r_version=$(basename $(dirname ${{ matrix.value }})) # TODO: check here if legacy renv (if yes, delete _legacy suffix and add _legacy suffix to docker im?) + renv=$(echo "${{ matrix.value }}" | tr -d '"') + echo "renv_lock_path=$renv" >> $GITHUB_OUTPUT + } echo "r_version=$r_version" >> $GITHUB_OUTPUT echo "image_name=$package_name-$r_version" >> $GITHUB_OUTPUT - renv=$(echo "${{ matrix.value }}" | tr -d '"') - echo "renv_lock_path=$renv" >> $GITHUB_OUTPUT - name: Call deploy docker image action for every renv - uses: insightsengineering/r-image-creator@v1 + uses: insightsengineering/r-image-creator@create_image_from_description + if: ${{ matrix.value }} != 'devel' with: image-name: "${{ steps.image_specs.outputs.image_name }}" tag-latest: true @@ -93,6 +100,19 @@ jobs: repository-owner: ${{ github.repository_owner }} repo-user: ${{ github.actor }} # pharmaverse-bot repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }} + + - name: Call deploy docker image action for every renv + uses: insightsengineering/r-image-creator@create_image_from_description + if: ${{ matrix.value }} == 'devel' + with: + image-name: "${{ steps.image_specs.outputs.image_name }}" + tag-latest: true + base-image: "rocker/rstudio:${{ steps.image_specs.outputs.r_version }}" + sysdeps: qpdf,libxt-dev,curl,npm,libicu-dev,libcurl4-openssl-dev,libssl-dev,make,zlib1g-dev,libfontconfig1-dev,libfreetype6-dev,libfribidi-dev,libharfbuzz-dev,libjpeg-dev,libpng-dev,libtiff-dev,pandoc,libxml2-dev,libgit2-dev,libgit2-dev,jq + description-file: "./DESCRIPTION" + repository-owner: ${{ github.repository_owner }} + repo-user: ${{ github.actor }} # pharmaverse-bot + repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }} # note: in case of 403 error when pushing to ghcr : link current repo to the given package registry - https://github.com/docker/build-push-action/issues/687 # (got to https://github.com/?tab=packages to go to packages settings) and there https://github.com/users//packages/container/admiralci-4.0/settings \ No newline at end of file diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 93f487ba..55cb54b8 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -37,6 +37,7 @@ jobs: - {r: '4.1', repos: 'https://packagemanager.posit.co/cran/2021-05-03/'} - {r: '4.2', repos: 'https://packagemanager.posit.co/cran/2022-01-03/'} - {r: '4.3', repos: 'https://packagemanager.posit.co/cran/__linux__/focal/latest'} + - {r: 'devel', repos: 'https://packagemanager.posit.co/cran/__linux__/focal/latest'} # not needed for devel ? env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -86,22 +87,30 @@ jobs: _R_CHECK_CRAN_INCOMING_REMOTE_: false _R_CHECK_FORCE_SUGGESTS_: false run: | - if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") + script=$(cat < Date: Tue, 24 Oct 2023 15:58:12 +0200 Subject: [PATCH 02/39] fix branch name --- .github/workflows/push-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index 107ba4e6..d957dd05 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -89,7 +89,7 @@ jobs: echo "image_name=$package_name-$r_version" >> $GITHUB_OUTPUT - name: Call deploy docker image action for every renv - uses: insightsengineering/r-image-creator@create_image_from_description + uses: insightsengineering/r-image-creator@feature/create_image_from_description if: ${{ matrix.value }} != 'devel' with: image-name: "${{ steps.image_specs.outputs.image_name }}" @@ -102,7 +102,7 @@ jobs: repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }} - name: Call deploy docker image action for every renv - uses: insightsengineering/r-image-creator@create_image_from_description + uses: insightsengineering/r-image-creator@feature/create_image_from_description if: ${{ matrix.value }} == 'devel' with: image-name: "${{ steps.image_specs.outputs.image_name }}" From 1236e00dc3c87c3583bcfca3f281561636fa1c62 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:55:20 +0200 Subject: [PATCH 03/39] update push job --- .github/workflows/push-docker-image.yml | 44 +++++++++++++++++-------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index d957dd05..75c89519 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -47,7 +47,6 @@ jobs: renv_list="${{ steps.changed-files.outputs.all_changed_files }}" fi renv_list=$(echo $renv_list | sed 's/ /", "/g') - renv_list="$renv_list devel" # adding devel conf echo "renv=[\"$renv_list\"]" >> $GITHUB_OUTPUT deploy-image: @@ -77,20 +76,14 @@ jobs: id: image_specs run: | package_name=$(grep "Package:" DESCRIPTION | awk '{print $NF}') - if [ "${{ matrix.value }}" == "devel" ]{ - r_version="devel" - } - else { - r_version=$(basename $(dirname ${{ matrix.value }})) # TODO: check here if legacy renv (if yes, delete _legacy suffix and add _legacy suffix to docker im?) - renv=$(echo "${{ matrix.value }}" | tr -d '"') - echo "renv_lock_path=$renv" >> $GITHUB_OUTPUT - } + r_version=$(basename $(dirname ${{ matrix.value }})) # TODO: check here if legacy renv (if yes, delete _legacy suffix and add _legacy suffix to docker im?) + renv=$(echo "${{ matrix.value }}" | tr -d '"') + echo "renv_lock_path=$renv" >> $GITHUB_OUTPUT echo "r_version=$r_version" >> $GITHUB_OUTPUT echo "image_name=$package_name-$r_version" >> $GITHUB_OUTPUT - name: Call deploy docker image action for every renv uses: insightsengineering/r-image-creator@feature/create_image_from_description - if: ${{ matrix.value }} != 'devel' with: image-name: "${{ steps.image_specs.outputs.image_name }}" tag-latest: true @@ -100,19 +93,42 @@ jobs: repository-owner: ${{ github.repository_owner }} repo-user: ${{ github.actor }} # pharmaverse-bot repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }} - - - name: Call deploy docker image action for every renv + + deploy-image-devel: + runs-on: ubuntu-latest + + # Token permissions + permissions: + contents: read + packages: write + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set image specs + id: image_specs + run: | + package_name=$(grep "Package:" DESCRIPTION | awk '{print $NF}') + echo "image_name=$package_name-devel" >> $GITHUB_OUTPUT + + - name: Call deploy docker image action devel uses: insightsengineering/r-image-creator@feature/create_image_from_description - if: ${{ matrix.value }} == 'devel' with: image-name: "${{ steps.image_specs.outputs.image_name }}" tag-latest: true - base-image: "rocker/rstudio:${{ steps.image_specs.outputs.r_version }}" + base-image: "rocker/rstudio:devel" sysdeps: qpdf,libxt-dev,curl,npm,libicu-dev,libcurl4-openssl-dev,libssl-dev,make,zlib1g-dev,libfontconfig1-dev,libfreetype6-dev,libfribidi-dev,libharfbuzz-dev,libjpeg-dev,libpng-dev,libtiff-dev,pandoc,libxml2-dev,libgit2-dev,libgit2-dev,jq description-file: "./DESCRIPTION" repository-owner: ${{ github.repository_owner }} repo-user: ${{ github.actor }} # pharmaverse-bot repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }} + +# refacto todo: image-name, sysdeps on get-renv-list job + + # note: in case of 403 error when pushing to ghcr : link current repo to the given package registry - https://github.com/docker/build-push-action/issues/687 # (got to https://github.com/?tab=packages to go to packages settings) and there https://github.com/users//packages/container/admiralci-4.0/settings \ No newline at end of file From 80516dac35b2b4016aa36b52dceb84267450aa2d Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:57:28 +0200 Subject: [PATCH 04/39] re-test --- .github/workflows/push-docker-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index 75c89519..d8977196 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -71,6 +71,7 @@ jobs: - name: Print message run: | echo "updating docker image for renv ${{ matrix.value }}" + exit 1 # TODO: del (for testing) - name: Set image specs id: image_specs From e79372ccc4dfb84144d2d94861c190c7fe071e6d Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Wed, 25 Oct 2023 10:14:16 +0200 Subject: [PATCH 05/39] fix checks --- .github/workflows/r-cmd-check.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 55cb54b8..d03b30a1 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -102,9 +102,15 @@ jobs: ) if [ ${{ matrix.config.r }} == "devel" ]; then - Rscript --vanilla --no-renv -e $script + # deactivate renv for devel checks + script=$(cat < Date: Wed, 25 Oct 2023 10:55:22 +0200 Subject: [PATCH 06/39] fix typo --- .github/workflows/r-cmd-check.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index d03b30a1..352d41ce 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -87,7 +87,7 @@ jobs: _R_CHECK_CRAN_INCOMING_REMOTE_: false _R_CHECK_FORCE_SUGGESTS_: false run: | - script=$(cat < Date: Wed, 25 Oct 2023 11:30:27 +0200 Subject: [PATCH 07/39] fix --- .github/workflows/r-cmd-check.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 352d41ce..c9c6e96e 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -101,12 +101,13 @@ jobs: if [ ${{ matrix.config.r }} == "devel" ]; then # deactivate renv for devel checks - script="renv::deactivate() + script=" + renv::deactivate() $script" - Rscript --vanilla -e $script - else - Rscript --vanilla -e $script + echo "$script" > checks.R fi + + Rscript --vanilla checks.R shell: bash - name: Upload check results From 2ce17dbeaae10180834d907673e4d470e2a6962b Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:36:47 +0200 Subject: [PATCH 08/39] fix --- .github/workflows/r-cmd-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index c9c6e96e..56e062c9 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -104,9 +104,10 @@ jobs: script=" renv::deactivate() $script" - echo "$script" > checks.R fi + echo "$script" > checks.R + Rscript --vanilla checks.R shell: bash From a5b603639fd11aeca63d6a4696394d21dca99474 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:38:17 +0200 Subject: [PATCH 09/39] fix --- .github/workflows/r-cmd-check.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 56e062c9..3431667b 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -99,12 +99,12 @@ jobs: check_dir = 'check' )" - if [ ${{ matrix.config.r }} == "devel" ]; then - # deactivate renv for devel checks - script=" - renv::deactivate() - $script" - fi + # if [ ${{ matrix.config.r }} == "devel" ]; then + # # deactivate renv for devel checks + # script=" + # renv::deactivate() + # $script" + # fi echo "$script" > checks.R From 40a30b0208330362a1ba4034fe2bd5aca68c9864 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:54:22 +0200 Subject: [PATCH 10/39] install rcmdcheck for devel im --- .github/workflows/r-cmd-check.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 3431667b..5efa7fc2 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -99,16 +99,13 @@ jobs: check_dir = 'check' )" - # if [ ${{ matrix.config.r }} == "devel" ]; then - # # deactivate renv for devel checks - # script=" - # renv::deactivate() - # $script" - # fi + if [ ${{ matrix.config.r }} == "devel" ]; then + R -e "install.packages('rcmdcheck')" + fi echo "$script" > checks.R - Rscript --vanilla checks.R + Rscript checks.R shell: bash - name: Upload check results From 1dc13897d1d5f0fc22def44c01a2b20a9e021ea2 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 10:13:25 +0200 Subject: [PATCH 11/39] templates: retrieve temp folder --- .github/workflows/check-templates.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index d373e019..c59dc9e2 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -198,6 +198,13 @@ jobs: } shell: Rscript {0} + - name: Get temp dir + run: | + folder_id=$(dirname $(find /tmp/ 2>/dev/null | grep .rda | head -n 1)) + echo "folder id: $folder_id" + # copy data from tmp folder + cp -r "/tmp/${folder_id}/." "$GITHUB_WORKSPACE/tmp/" + - name: Add other data formats and suffixes, exclude data if: inputs.push-templates-data run: | From aad06e3014185923e456f0f59ba54eeeeeeffe70 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 10:38:34 +0200 Subject: [PATCH 12/39] add checks on existing branches - templates --- .github/workflows/check-templates.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index c59dc9e2..a0125ab6 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -384,13 +384,18 @@ jobs: id: branch run: | repo_name=$(basename "${{ github.repository }}") - echo "source-branch=${{ env.source-branch }}_${repo_name}@devel" >> $GITHUB_OUTPUT + source_br="${{ env.source-branch }}_${repo_name}@devel" + source_grep=$(git branch -a | grep $source_br) + if [ -z $source_grep ]; then branch_exists=false; else branch_exists=true; fi + echo "source-branch=$source_br" >> $GITHUB_OUTPUT + echo "branch-exists=$branch_exists" >> $GITHUB_OUTPUT + warn_msg="WARNING:: the branch $source_br already exists in pharmaverseadam, please merge it and delete it, and re-execute this job" + if [ ${{ steps.changes.outputs.diff }} == 'true' ] && [ "$branch_exists" == 'true' ]; then echo "$warn_msg"; fi shell: bash {0} - # if diff detected, push changes - name: Commit and push changes in {{ env.repo }} - if: ${{ inputs.push-templates-data && steps.changes.outputs.diff == 'true' }} + if: ${{ inputs.push-templates-data && steps.changes.outputs.diff == 'true' && steps.branch.outputs.branch-exists == 'false' }} uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: templates data updates from ${{ github.repository }} @@ -401,7 +406,7 @@ jobs: create_branch: true - name: Create Pull Request - if: ${{ inputs.push-templates-data && steps.changes.outputs.diff == 'true' }} + if: ${{ inputs.push-templates-data && steps.changes.outputs.diff == 'true' && steps.branch.outputs.branch-exists == 'false' }} uses: actions/github-script@v6 with: github-token: ${{ secrets.PHARMAVERSE_BOT }} From 06ce9fc033dcc8601a241f46661edac9c7c08802 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:04:46 +0200 Subject: [PATCH 13/39] debug traces --- .github/workflows/check-templates.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index a0125ab6..eb269ab1 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -200,7 +200,9 @@ jobs: - name: Get temp dir run: | - folder_id=$(dirname $(find /tmp/ 2>/dev/null | grep .rda | head -n 1)) + find /tmp/ 2>/dev/null | grep .rda + rda_files=$(find /tmp/ 2>/dev/null | grep .rda | head -n 1) + folder_id=$(dirname $rda_files) echo "folder id: $folder_id" # copy data from tmp folder cp -r "/tmp/${folder_id}/." "$GITHUB_WORKSPACE/tmp/" From 466e5fa441d620b311f0f43e6fb334541f4e7113 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:16:49 +0200 Subject: [PATCH 14/39] fix cp cmd --- .github/workflows/check-templates.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index eb269ab1..57449a16 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -205,7 +205,8 @@ jobs: folder_id=$(dirname $rda_files) echo "folder id: $folder_id" # copy data from tmp folder - cp -r "/tmp/${folder_id}/." "$GITHUB_WORKSPACE/tmp/" + mkdir -p "$GITHUB_WORKSPACE/tmp/" + cp -r "${folder_id}/." "$GITHUB_WORKSPACE/tmp/" - name: Add other data formats and suffixes, exclude data if: inputs.push-templates-data From 91acb1d70c1c16b3aa4ca1c08c808c293c8eb7f9 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:24:50 +0200 Subject: [PATCH 15/39] fix --- .github/workflows/check-templates.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 57449a16..ad4b2c24 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -207,6 +207,7 @@ jobs: # copy data from tmp folder mkdir -p "$GITHUB_WORKSPACE/tmp/" cp -r "${folder_id}/." "$GITHUB_WORKSPACE/tmp/" + shell: bash - name: Add other data formats and suffixes, exclude data if: inputs.push-templates-data From d0e2ad902cf80e66448181edb41966fe2575e29d Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:39:05 +0200 Subject: [PATCH 16/39] debug traces --- .github/workflows/check-templates.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index ad4b2c24..fe30b12e 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -200,8 +200,12 @@ jobs: - name: Get temp dir run: | + find /tmp/ 2>/dev/null + echo "debug1" find /tmp/ 2>/dev/null | grep .rda + echo "debug2" rda_files=$(find /tmp/ 2>/dev/null | grep .rda | head -n 1) + echo "debug3" folder_id=$(dirname $rda_files) echo "folder id: $folder_id" # copy data from tmp folder From 1f82e55b90952dd69a25a27e3ad3110a5a39511c Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:24:18 +0200 Subject: [PATCH 17/39] add other debug traces --- .github/workflows/check-templates.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index fe30b12e..0cda3db9 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -201,6 +201,7 @@ jobs: - name: Get temp dir run: | find /tmp/ 2>/dev/null + ls -al /tmp echo "debug1" find /tmp/ 2>/dev/null | grep .rda echo "debug2" From 9b0a4b62b585a2a2e62e0ed7c21183989e4dff22 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:48:21 +0200 Subject: [PATCH 18/39] update --- .github/workflows/check-templates.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 0cda3db9..9c7b6c40 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -186,6 +186,14 @@ jobs: exit_codes <- purrr::map_chr(templates, function(file) { cmd <- sprintf("Rscript --vanilla %s", file) system(cmd) + # move produced rda file to another location + subdirectories <- list.dirs("/tmp", full.names = TRUE) + rda_files <- list.files(subdirectories, pattern = "\\.rda$", recursive = TRUE, full.names = TRUE) + if (length(rda_files) > 0) { + current_rda_file <- rda_files[1] + file.copy(current_rda_file, file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) + file.remove(current_rda_file) + } }) if (any(exit_codes == 1L)) { failed_scripts <- basename(templates)[which(exit_codes == 1L)] @@ -198,22 +206,6 @@ jobs: } shell: Rscript {0} - - name: Get temp dir - run: | - find /tmp/ 2>/dev/null - ls -al /tmp - echo "debug1" - find /tmp/ 2>/dev/null | grep .rda - echo "debug2" - rda_files=$(find /tmp/ 2>/dev/null | grep .rda | head -n 1) - echo "debug3" - folder_id=$(dirname $rda_files) - echo "folder id: $folder_id" - # copy data from tmp folder - mkdir -p "$GITHUB_WORKSPACE/tmp/" - cp -r "${folder_id}/." "$GITHUB_WORKSPACE/tmp/" - shell: bash - - name: Add other data formats and suffixes, exclude data if: inputs.push-templates-data run: | From d3011fe96465f0b0e00cf720227fdbd8a724ed74 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:17:55 +0200 Subject: [PATCH 19/39] add other debug traces --- .github/workflows/check-templates.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 9c7b6c40..7c03f782 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -188,9 +188,16 @@ jobs: system(cmd) # move produced rda file to another location subdirectories <- list.dirs("/tmp", full.names = TRUE) + print("subdirectories") + print(subdirectories) rda_files <- list.files(subdirectories, pattern = "\\.rda$", recursive = TRUE, full.names = TRUE) + print("rda_files") + print(rda_files) if (length(rda_files) > 0) { current_rda_file <- rda_files[1] + print("other traces") + print(current_rda_file) + print(file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) file.copy(current_rda_file, file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) file.remove(current_rda_file) } From 64455140f0d6ac36dbdeb93c09666cd5d9cc1895 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:56:14 +0200 Subject: [PATCH 20/39] test other folder --- .github/workflows/check-templates.yml | 37 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 7c03f782..ce05d01c 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -186,21 +186,21 @@ jobs: exit_codes <- purrr::map_chr(templates, function(file) { cmd <- sprintf("Rscript --vanilla %s", file) system(cmd) - # move produced rda file to another location - subdirectories <- list.dirs("/tmp", full.names = TRUE) - print("subdirectories") - print(subdirectories) - rda_files <- list.files(subdirectories, pattern = "\\.rda$", recursive = TRUE, full.names = TRUE) - print("rda_files") - print(rda_files) - if (length(rda_files) > 0) { - current_rda_file <- rda_files[1] - print("other traces") - print(current_rda_file) - print(file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) - file.copy(current_rda_file, file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) - file.remove(current_rda_file) - } + # # move produced rda file to another location + # subdirectories <- list.dirs("/tmp", full.names = TRUE) + # print("subdirectories") + # print(subdirectories) + # rda_files <- list.files(subdirectories, pattern = "\\.rda$", recursive = TRUE, full.names = TRUE) + # print("rda_files") + # print(rda_files) + # if (length(rda_files) > 0) { + # current_rda_file <- rda_files[1] + # print("other traces") + # print(current_rda_file) + # print(file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) + # file.copy(current_rda_file, file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) + # file.remove(current_rda_file) + # } }) if (any(exit_codes == 1L)) { failed_scripts <- basename(templates)[which(exit_codes == 1L)] @@ -212,6 +212,13 @@ jobs: } } shell: Rscript {0} + + - name: Test tmp folder + run: | + ls /tmp/ + find /tmp/ + ls /tmp/templates_data + cp -r /tmp/templates_data/. "$GITHUB_WORKSPACE/tmp" - name: Add other data formats and suffixes, exclude data if: inputs.push-templates-data From b2c7ab6a4d40d9aa76831d147960f5f89e87531c Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:07:48 +0200 Subject: [PATCH 21/39] fix condition branch --- .github/workflows/check-templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index ce05d01c..5e155526 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -405,7 +405,7 @@ jobs: echo "source-branch=$source_br" >> $GITHUB_OUTPUT echo "branch-exists=$branch_exists" >> $GITHUB_OUTPUT warn_msg="WARNING:: the branch $source_br already exists in pharmaverseadam, please merge it and delete it, and re-execute this job" - if [ ${{ steps.changes.outputs.diff }} == 'true' ] && [ "$branch_exists" == 'true' ]; then echo "$warn_msg"; fi + if [ '${{ steps.changes.outputs.diff }}' == 'true' ] && [ '$branch_exists' == 'true' ]; then echo "$warn_msg"; fi shell: bash {0} # if diff detected, push changes From d34d1ea1e958dbf8ba5d0051bae0e89702671ee3 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:44:51 +0100 Subject: [PATCH 22/39] fix checks --- .github/workflows/push-docker-image.yml | 1 - .github/workflows/r-cmd-check.yml | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index d8977196..75c89519 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -71,7 +71,6 @@ jobs: - name: Print message run: | echo "updating docker image for renv ${{ matrix.value }}" - exit 1 # TODO: del (for testing) - name: Set image specs id: image_specs diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 5efa7fc2..d0cdce37 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -106,6 +106,8 @@ jobs: echo "$script" > checks.R Rscript checks.R + + rm -f checks.R shell: bash - name: Upload check results From 40aa7d3edf9389c84a2ad29ab4d79fe5ee956c64 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:15:33 +0100 Subject: [PATCH 23/39] test checks on maintenance versions --- .github/workflows/r-cmd-check.yml | 48 ++++++++++++++++++++----------- DESCRIPTION | 2 +- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index d0cdce37..46c4e2e0 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -87,28 +87,42 @@ jobs: _R_CHECK_CRAN_INCOMING_REMOTE_: false _R_CHECK_FORCE_SUGGESTS_: false run: | - script=" + description_old <- readLines("DESCRIPTION") + description_dat <- description_old + for (i in seq_along(description_dat)) { + if (grepl("^Version:", description_dat[i])) { + current_version <- sub("^Version: ", "", description_dat[i]) + version_parts <- strsplit(current_version, "\\.")[[1]] + + # check if maintenance version - if yes, temp update the DESCRIPTION for rcmdchecks + if (length(version_parts) == 4) { + print("Maintenance version detected (format X.Y.Z.M with M >= 9000)") + version_parts <- version_parts[1:3] + } + + new_version <- paste(version_parts, collapse = ".") + description_dat[i] <- paste("Version: ", new_version) + } + } + + # Write the updated DESCRIPTION file back + writeLines(description_dat, con = description_file_path) + + if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) - check_error_on <- '${{ inputs.error-on }}' - if (check_error_on == '') { - check_error_on <- 'note' + check_error_on <- "${{ inputs.error-on }}" + if (check_error_on == "") { + check_error_on <- "note" } rcmdcheck::rcmdcheck( - args = c('--no-manual', '--as-cran'), + args = c("--no-manual", "--as-cran"), error_on = check_error_on, - check_dir = 'check' - )" - - if [ ${{ matrix.config.r }} == "devel" ]; then - R -e "install.packages('rcmdcheck')" - fi - - echo "$script" > checks.R - - Rscript checks.R + check_dir = "check" + ) - rm -f checks.R - shell: bash + # Write back initial description file + writeLines(description_dat, con = description_file_path) + shell: Rscript {0} - name: Upload check results if: failure() diff --git a/DESCRIPTION b/DESCRIPTION index 3fb8017e..c89d1fcf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: admiralci Type: Package Title: ADaM in R Asset Library - CI/CD Workflows -Version: 0.0.1 +Version: 0.0.1.9001 Authors@R: c( person("Open", "Source", email = "admiralci@pharmaverse.com", role = c("aut", "cre"))) Description: A set of common CI/CD workflows originally designed and developed for From 31f569e9765b3ea298f518d6474097e11fc05084 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:17:22 +0100 Subject: [PATCH 24/39] fix --- .github/workflows/r-cmd-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 46c4e2e0..8d74f133 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -106,7 +106,7 @@ jobs: } # Write the updated DESCRIPTION file back - writeLines(description_dat, con = description_file_path) + writeLines(description_dat, con = "DESCRIPTION") if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) @@ -121,7 +121,7 @@ jobs: ) # Write back initial description file - writeLines(description_dat, con = description_file_path) + writeLines(description_dat, con = "DESCRIPTION") shell: Rscript {0} - name: Upload check results From c43f3f45ed325d9c12cf39e6bee245cf1cb032ca Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:24:56 +0100 Subject: [PATCH 25/39] trigger checks --- .github/workflows/r-cmd-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 8d74f133..b9725ff2 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -106,7 +106,7 @@ jobs: } # Write the updated DESCRIPTION file back - writeLines(description_dat, con = "DESCRIPTION") + #writeLines(description_dat, con = "DESCRIPTION") if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) From 9f978eb5fd8a7832e7979e5efd9b736684585ecd Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:28:37 +0100 Subject: [PATCH 26/39] try ignore note --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index 97cadc2e..a19b2a9d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,3 +28,4 @@ ^staged_dependencies.yaml$ ^README.Rmd$ ^.devcontainer +^Version contains large components|^*NOTE*: \ No newline at end of file From f93f2b1e61f2eee65454ba6892ec5cd7d065daeb Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:30:56 +0100 Subject: [PATCH 27/39] retry --- .Rbuildignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index a19b2a9d..11b81b8f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,4 +28,4 @@ ^staged_dependencies.yaml$ ^README.Rmd$ ^.devcontainer -^Version contains large components|^*NOTE*: \ No newline at end of file +^Version contains large components|^\*NOTE\*: \ No newline at end of file From 5148dad7d6ed02eac92fdf8102d67242b4ea3d1b Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:33:58 +0100 Subject: [PATCH 28/39] try another regexp --- .Rbuildignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 11b81b8f..5a720691 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,4 +28,4 @@ ^staged_dependencies.yaml$ ^README.Rmd$ ^.devcontainer -^Version contains large components|^\*NOTE\*: \ No newline at end of file +^Version contains large components \(\d+\.\d+\.\d+\.\d+\)|^\*NOTE\*: \ No newline at end of file From a12985d4704c791820c587217265bdab69ea485b Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:37:21 +0100 Subject: [PATCH 29/39] retry --- .Rbuildignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 5a720691..5f1ca6ae 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,4 +28,4 @@ ^staged_dependencies.yaml$ ^README.Rmd$ ^.devcontainer -^Version contains large components \(\d+\.\d+\.\d+\.\d+\)|^\*NOTE\*: \ No newline at end of file +^Version contains large components.*|^\*NOTE\*: \ No newline at end of file From 82e47cdc887abaea0389b66c46705c7608777ffb Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:49:28 +0100 Subject: [PATCH 30/39] rework rcmdcheck --- .github/workflows/propagate.yml | 1 + .github/workflows/r-cmd-check.yml | 32 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/propagate.yml b/.github/workflows/propagate.yml index 3160f9db..ef04b288 100644 --- a/.github/workflows/propagate.yml +++ b/.github/workflows/propagate.yml @@ -13,6 +13,7 @@ on: - renv/** - .Rprofile - .devcontainer/* + workflow_dispatch: # give possibility to run it manually jobs: integrity: diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index b9725ff2..4ba4cdf1 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -82,32 +82,31 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} #####################c##################### - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - _R_CHECK_FORCE_SUGGESTS_: false + - name: Check Version + id: check_version run: | - description_old <- readLines("DESCRIPTION") - description_dat <- description_old + maintenance_version="F" + description_dat <- readLines("DESCRIPTION") for (i in seq_along(description_dat)) { if (grepl("^Version:", description_dat[i])) { current_version <- sub("^Version: ", "", description_dat[i]) version_parts <- strsplit(current_version, "\\.")[[1]] - # check if maintenance version - if yes, temp update the DESCRIPTION for rcmdchecks if (length(version_parts) == 4) { print("Maintenance version detected (format X.Y.Z.M with M >= 9000)") - version_parts <- version_parts[1:3] + maintenance_version="T" } - - new_version <- paste(version_parts, collapse = ".") - description_dat[i] <- paste("Version: ", new_version) } } - - # Write the updated DESCRIPTION file back - #writeLines(description_dat, con = "DESCRIPTION") - + cat(paste("maintenance_version=", maintenance_version), file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) + + - name: Check + env: + _R_CHECK_FORCE_SUGGESTS_: false + run: | + if ( "${{ steps.check_version.outputs.maintenance_version }}" == "T" ){ + Sys.setenv(_R_CHECK_CRAN_INCOMING_REMOTE_ = TRUE) # we do not check if package is suitable for publication on CRAN in case of maintenance version + } if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) check_error_on <- "${{ inputs.error-on }}" @@ -119,9 +118,6 @@ jobs: error_on = check_error_on, check_dir = "check" ) - - # Write back initial description file - writeLines(description_dat, con = "DESCRIPTION") shell: Rscript {0} - name: Upload check results From 8e817e12c271fee4e9d68d6c74cfb964e4a8d058 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:52:55 +0100 Subject: [PATCH 31/39] fix --- .github/workflows/r-cmd-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 4ba4cdf1..b3db1942 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -99,6 +99,7 @@ jobs: } } cat(paste("maintenance_version=", maintenance_version), file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) + shell: Rscript {0} - name: Check env: From 381d596f199e3abc2963cc1bbcf18a3459d323a1 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:56:09 +0100 Subject: [PATCH 32/39] fix --- .github/workflows/r-cmd-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index b3db1942..5cc9d1e7 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -105,7 +105,7 @@ jobs: env: _R_CHECK_FORCE_SUGGESTS_: false run: | - if ( "${{ steps.check_version.outputs.maintenance_version }}" == "T" ){ + if ("${{steps.check_version.outputs.maintenance_version}}" == "T"){ Sys.setenv(_R_CHECK_CRAN_INCOMING_REMOTE_ = TRUE) # we do not check if package is suitable for publication on CRAN in case of maintenance version } if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") From 19cfc995355ebc0955e23d2a443ce86c104767d4 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:00:06 +0100 Subject: [PATCH 33/39] fix --- .github/workflows/r-cmd-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 5cc9d1e7..697c53df 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -98,7 +98,7 @@ jobs: } } } - cat(paste("maintenance_version=", maintenance_version), file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) + cat(sprintf("maintenance_version=%s", maintenance_version), file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) shell: Rscript {0} - name: Check @@ -106,7 +106,7 @@ jobs: _R_CHECK_FORCE_SUGGESTS_: false run: | if ("${{steps.check_version.outputs.maintenance_version}}" == "T"){ - Sys.setenv(_R_CHECK_CRAN_INCOMING_REMOTE_ = TRUE) # we do not check if package is suitable for publication on CRAN in case of maintenance version + Sys.setenv("_R_CHECK_CRAN_INCOMING_REMOTE_" = TRUE) } if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) From b272317df2573f57a198a58d9d3a49018892e94d Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:10:13 +0100 Subject: [PATCH 34/39] fix --- .github/workflows/r-cmd-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 697c53df..9167ba10 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -103,10 +103,11 @@ jobs: - name: Check env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false _R_CHECK_FORCE_SUGGESTS_: false run: | if ("${{steps.check_version.outputs.maintenance_version}}" == "T"){ - Sys.setenv("_R_CHECK_CRAN_INCOMING_REMOTE_" = TRUE) + Sys.setenv("_R_CHECK_CRAN_INCOMING_" = TRUE) } if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) From b6a0f89ba9f7ca577c68859e380d50a967a9f665 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:16:43 +0100 Subject: [PATCH 35/39] fix --- .github/workflows/r-cmd-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r-cmd-check.yml b/.github/workflows/r-cmd-check.yml index 9167ba10..8af921dd 100644 --- a/.github/workflows/r-cmd-check.yml +++ b/.github/workflows/r-cmd-check.yml @@ -107,7 +107,7 @@ jobs: _R_CHECK_FORCE_SUGGESTS_: false run: | if ("${{steps.check_version.outputs.maintenance_version}}" == "T"){ - Sys.setenv("_R_CHECK_CRAN_INCOMING_" = TRUE) + Sys.setenv("_R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION_" = TRUE) } if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") options(crayon.enabled = TRUE) From 889d1f98fa04d7e399ecc0ea3a66478fbeb5426e Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:50:08 +0100 Subject: [PATCH 36/39] cleanup --- .Rbuildignore | 3 +-- .github/workflows/check-templates.yml | 22 ---------------------- DESCRIPTION | 2 +- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 5f1ca6ae..531fcbbf 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -27,5 +27,4 @@ ^admiralci.*\.tgz$ ^staged_dependencies.yaml$ ^README.Rmd$ -^.devcontainer -^Version contains large components.*|^\*NOTE\*: \ No newline at end of file +^.devcontainer \ No newline at end of file diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 76ad589a..37b9214d 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -174,21 +174,6 @@ jobs: exit_codes <- purrr::map_chr(templates, function(file) { cmd <- sprintf("Rscript --vanilla %s", file) system(cmd) - # # move produced rda file to another location - # subdirectories <- list.dirs("/tmp", full.names = TRUE) - # print("subdirectories") - # print(subdirectories) - # rda_files <- list.files(subdirectories, pattern = "\\.rda$", recursive = TRUE, full.names = TRUE) - # print("rda_files") - # print(rda_files) - # if (length(rda_files) > 0) { - # current_rda_file <- rda_files[1] - # print("other traces") - # print(current_rda_file) - # print(file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) - # file.copy(current_rda_file, file.path(file.path(Sys.getenv("GITHUB_WORKSPACE"), "tmp"), basename(current_rda_file))) - # file.remove(current_rda_file) - # } }) if (any(exit_codes == 1L)) { failed_scripts <- basename(templates)[which(exit_codes == 1L)] @@ -200,13 +185,6 @@ jobs: } } shell: Rscript {0} - - - name: Test tmp folder - run: | - ls /tmp/ - find /tmp/ - ls /tmp/templates_data - cp -r /tmp/templates_data/. "$GITHUB_WORKSPACE/tmp" - name: Add other data formats and suffixes, exclude data if: inputs.push-templates-data diff --git a/DESCRIPTION b/DESCRIPTION index c89d1fcf..3fb8017e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: admiralci Type: Package Title: ADaM in R Asset Library - CI/CD Workflows -Version: 0.0.1.9001 +Version: 0.0.1 Authors@R: c( person("Open", "Source", email = "admiralci@pharmaverse.com", role = c("aut", "cre"))) Description: A set of common CI/CD workflows originally designed and developed for From c021700d1faeb6ccdb5758498143d6aa33ec6419 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:11:34 +0100 Subject: [PATCH 37/39] change r-im-creator tag --- .github/workflows/push-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index 75c89519..3ae3c77b 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -83,7 +83,7 @@ jobs: echo "image_name=$package_name-$r_version" >> $GITHUB_OUTPUT - name: Call deploy docker image action for every renv - uses: insightsengineering/r-image-creator@feature/create_image_from_description + uses: insightsengineering/r-image-creator@v1 with: image-name: "${{ steps.image_specs.outputs.image_name }}" tag-latest: true @@ -115,7 +115,7 @@ jobs: echo "image_name=$package_name-devel" >> $GITHUB_OUTPUT - name: Call deploy docker image action devel - uses: insightsengineering/r-image-creator@feature/create_image_from_description + uses: insightsengineering/r-image-creator@v1 with: image-name: "${{ steps.image_specs.outputs.image_name }}" tag-latest: true From e7c2913b334b8b8678b82cd99c8645858c6be2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:09:32 +0100 Subject: [PATCH 38/39] Update check-templates.yml remove @devel --- .github/workflows/check-templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-templates.yml b/.github/workflows/check-templates.yml index 37b9214d..059c44ae 100644 --- a/.github/workflows/check-templates.yml +++ b/.github/workflows/check-templates.yml @@ -365,7 +365,7 @@ jobs: id: branch run: | repo_name=$(basename "${{ github.repository }}") - source_br="${{ env.source-branch }}_${repo_name}@devel" + source_br="${{ env.source-branch }}_${repo_name}" source_grep=$(git branch -a | grep $source_br) if [ -z $source_grep ]; then branch_exists=false; else branch_exists=true; fi echo "source-branch=$source_br" >> $GITHUB_OUTPUT From ea523c719db282c5d2e80b7460a02c5722ee7d84 Mon Sep 17 00:00:00 2001 From: pharmaverse-bot <113703390+pharmaverse-bot@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:49:56 +0100 Subject: [PATCH 39/39] add cron job --- .github/workflows/push-docker-image.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index 3ae3c77b..5d2677ec 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -8,6 +8,8 @@ on: paths: - 'renv/profiles/**/renv.lock' workflow_dispatch: # give possibility to run it manually + schedule: + - cron: '0 0 * * *' # Run every day at midnight UTC permissions: write-all env: @@ -50,6 +52,7 @@ jobs: echo "renv=[\"$renv_list\"]" >> $GITHUB_OUTPUT deploy-image: + if: github.event_name != 'schedule' needs: [ get_renv_list ] runs-on: ubuntu-latest strategy: @@ -96,7 +99,6 @@ jobs: deploy-image-devel: runs-on: ubuntu-latest - # Token permissions permissions: contents: read