Skip to content

Commit

Permalink
Dynamic grab package name
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Sparre Spiegelhauer (HSPU) committed Mar 15, 2024
1 parent ed3ce1f commit 759c975
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,30 @@ 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"),
clean=FALSE,
quiet=FALSE
)
shell: Rscript {0}

- name: Show testthat output in console
if: always()
run: |
Expand Down

0 comments on commit 759c975

Please sign in to comment.