-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add devel image #165
Add devel image #165
Changes from 38 commits
1bf5f11
6097514
1236e00
80516da
e79372c
eef1305
506ff15
2ce17db
a5b6036
40a30b0
1dc1389
aad06e3
06ce9fc
466e5fa
91acb1d
d0e2ad9
1f82e55
9b0a4b6
d3011fe
6445514
b2c7ab6
0c23a4a
d34d1ea
40aa7d3
31f569e
c43f3f4
9f978eb
f93f2b1
5148dad
a12985d
82e47cd
8e817e1
381d596
19cfc99
b272317
b6a0f89
889d1f9
c021700
e7c2913
ea523c7
829a8f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ | |
^admiralci.*\.tgz$ | ||
^staged_dependencies.yaml$ | ||
^README.Rmd$ | ||
^.devcontainer | ||
^.devcontainer |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,10 +77,10 @@ jobs: | |
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?) | ||
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 | ||
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@v1 | ||
|
@@ -94,5 +94,41 @@ jobs: | |
repo-user: ${{ github.actor }} # pharmaverse-bot | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" # ${{ secrets.PHARMAVERSE_BOT }} | ||
|
||
deploy-image-devel: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add step to deploy devel image |
||
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@v1 | ||
with: | ||
image-name: "${{ steps.image_specs.outputs.image_name }}" | ||
tag-latest: true | ||
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/<user name>?tab=packages to go to packages settings) and there https://github.com/users/<user name>/packages/container/admiralci-4.0/settings |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -81,11 +82,33 @@ jobs: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
#####################c##################### | ||
|
||
- name: Check Version | ||
id: check_version | ||
run: | | ||
maintenance_version="F" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here this is a step to check if version has this pattern x.y.x.m with m >= 9000 - if this is the case then on next step we are doing this : Sys.setenv("R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION" = TRUE) to avoid having notes on rcmdchecks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd recommend just setting this as a top-level environment var instead of a session-specific var. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah sure? (because I see this more like temp setup to just enable checks in case of dev version) - but np to change this ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, never mind. Your implementation should work. Keep it as-is. |
||
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)") | ||
maintenance_version="T" | ||
} | ||
} | ||
} | ||
cat(sprintf("maintenance_version=%s", maintenance_version), file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) | ||
shell: Rscript {0} | ||
|
||
- 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_SKIP_LARGE_VERSION_" = TRUE) | ||
} | ||
if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck") | ||
options(crayon.enabled = TRUE) | ||
check_error_on <- "${{ inputs.error-on }}" | ||
|
@@ -103,5 +126,5 @@ jobs: | |
if: failure() | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | ||
path: check | ||
name: r${{ matrix.config.r }}-results | ||
path: check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cicdguy : since this PR includes several changes I just add some comments ! here I added this change for pharmaverseadam datasets creation (since we push updates to a new branch, I just make a check before to see if the branch exists - if not we do not trigger the "commit and push changes" step (then we avoid error cases that we often have since pharmaverseadam maintainers might sometimes forget to merge some pending PRs..)
I also thought creating unique branch but would be super messy I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
BTW you do not need the
@devel
suffix anymore for the branch names since everything now usesmain
as the default branchThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes indeed you're right :) just from some old runs I guess I just forgot to delete it 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(done)