From 759c97551597b567f2465bc20e204dff83d13b8f Mon Sep 17 00:00:00 2001 From: "Henrik Sparre Spiegelhauer (HSPU)" Date: Fri, 15 Mar 2024 16:06:50 +0100 Subject: [PATCH] Dynamic grab package name --- .github/workflows/Test.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Test.yaml b/.github/workflows/Test.yaml index e6e3448..b045a88 100644 --- a/.github/workflows/Test.yaml +++ b/.github/workflows/Test.yaml @@ -41,12 +41,22 @@ jobs: # ) # shell: Rscript {0} + - name: Get package name + run: | + echo "PKGNAME=$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)" >> $GITHUB_ENV + shell: bash + + - name: debug + run: | + echo $PKGNAME + shell: bash + - name: Run tests with coverage run: | covr::codecov( type = "none", code = "testthat::test_package( - 'chefStats', + Sys.getenv('PKGNAME'), reporter = testthat::JunitReporter$new(file = file.path(normalizePath(Sys.getenv('GITHUB_WORKSPACE'), winslash = '/'), 'test-results.xml')) )", install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"), @@ -54,7 +64,7 @@ jobs: quiet=FALSE ) shell: Rscript {0} - + - name: Show testthat output in console if: always() run: |