From 34f03fcae1ade47d6d569a840d1e5dcba2f3532b Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Tue, 27 Aug 2024 16:42:31 +0200 Subject: [PATCH] Write commit into install.R for devel install --- .github/actions/check-pharmr/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/actions/check-pharmr/action.yml b/.github/actions/check-pharmr/action.yml index 6ffe5a5..16134f5 100644 --- a/.github/actions/check-pharmr/action.yml +++ b/.github/actions/check-pharmr/action.yml @@ -37,6 +37,19 @@ runs: devtools::document() shell: Rscript {0} + - name: Update commit hash for development install + working-directory: pharmr_repo + run: | + import subprocess + commit = subprocess.getoutput("git -C ../pharmpy_repo rev-parse HEAD") + with open("R/install.R", "r") as fp: + lines = fp.readlines() + lines[0] = f'"{commit}"' + with open("R/install.R", "w") as fp: + for line in lines: + fp.write(line) + shell: python + - name: Build source package run: R CMD build pharmr_repo shell: bash