From f4e1262174acd123e89fa9c18df55b6e84e201b3 Mon Sep 17 00:00:00 2001 From: Daphne Grasselly Date: Tue, 5 Sep 2023 17:44:55 +0200 Subject: [PATCH 1/9] add templates --- .github/workflows/templates.yml | 19 +++++++++++++++++++ inst/templates/ad_adrs.R | 9 +++++++-- inst/templates/ad_adrs_basic.R | 9 +++++++-- inst/templates/ad_adtr.R | 10 ++++++++++ inst/templates/ad_adtte.R | 9 +++++++-- 5 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/templates.yml diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml new file mode 100644 index 00000000..54d284fb --- /dev/null +++ b/.github/workflows/templates.yml @@ -0,0 +1,19 @@ +--- +name: Check Templates + +on: + workflow_dispatch: + push: + branches: + - main + - devel + - 618_templates_action + +jobs: + templates: + name: Check Templates + uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@618_templates_action + secrets: inherit + #if: github.event_name == 'pull_request' + with: + r-version: "4.1" diff --git a/inst/templates/ad_adrs.R b/inst/templates/ad_adrs.R index 0a75f46e..dac3af57 100644 --- a/inst/templates/ad_adrs.R +++ b/inst/templates/ad_adrs.R @@ -398,5 +398,10 @@ adrs <- adrs %>% # Save output ---- -dir <- tempdir() # Change to whichever directory you want to save the dataset in -saveRDS(adrs, file = file.path(dir, "adrs.rds"), compress = "bzip2") +dir <- file.path(getwd(), "tmp") +print(dir) +if (!file.exists(dir)) { + # Create the folder + dir.create(dir) +} +save(adrs, file = file.path(dir, "adrs.rda"), compress = "bzip2") diff --git a/inst/templates/ad_adrs_basic.R b/inst/templates/ad_adrs_basic.R index f3c1125a..05d84329 100644 --- a/inst/templates/ad_adrs_basic.R +++ b/inst/templates/ad_adrs_basic.R @@ -372,5 +372,10 @@ adrs <- adrs %>% # ---- Save output ---- -dir <- tempdir() # Change to whichever directory you want to save the dataset in -saveRDS(adrs, file = file.path(dir, "adrs.rds"), compress = "bzip2") +dir <- file.path(getwd(), "tmp") +print(dir) +if (!file.exists(dir)) { + # Create the folder + dir.create(dir) +} +save(adrs, file = file.path(dir, "adrs_basic.rda"), compress = "bzip2") diff --git a/inst/templates/ad_adtr.R b/inst/templates/ad_adtr.R index 8183a80c..686c106d 100644 --- a/inst/templates/ad_adtr.R +++ b/inst/templates/ad_adtr.R @@ -280,3 +280,13 @@ adtr <- adtr %>% dataset_add = select(adsl, !!!negate_vars(adsl_vars)), by_vars = exprs(STUDYID, USUBJID) ) + +# Save output ---- + +dir <- file.path(getwd(), "tmp") +print(dir) +if (!file.exists(dir)) { + # Create the folder + dir.create(dir) +} +save(adtr, file = file.path(dir, "adtr.rda"), compress = "bzip2") diff --git a/inst/templates/ad_adtte.R b/inst/templates/ad_adtte.R index 863032a9..5c186141 100644 --- a/inst/templates/ad_adtte.R +++ b/inst/templates/ad_adtte.R @@ -82,5 +82,10 @@ adtte <- adtte %>% # Save output ---- -dir <- tempdir() # Change to whichever directory you want to save the dataset in -saveRDS(adtte, file = file.path(dir, "adtte.rds"), compress = "bzip2") +dir <- file.path(getwd(), "tmp") +print(dir) +if (!file.exists(dir)) { + # Create the folder + dir.create(dir) +} +save(adtte, file = file.path(dir, "adtte.rda"), compress = "bzip2") From 375e5d0bc9d31ea9b479a35f25c3648943aba333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:03:14 +0200 Subject: [PATCH 2/9] trigger --- .github/workflows/templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 54d284fb..e6eb757d 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -14,6 +14,6 @@ jobs: name: Check Templates uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@618_templates_action secrets: inherit - #if: github.event_name == 'pull_request' + #if: github.event_name == 'pull_request' with: r-version: "4.1" From c8a8f6d01e12f320e80f958535abb53c6b434890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:15:23 +0200 Subject: [PATCH 3/9] trigger --- .github/workflows/templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index e6eb757d..54d284fb 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -14,6 +14,6 @@ jobs: name: Check Templates uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@618_templates_action secrets: inherit - #if: github.event_name == 'pull_request' + #if: github.event_name == 'pull_request' with: r-version: "4.1" From d421096787c055c50fb7784f834374d732658722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:16:24 +0200 Subject: [PATCH 4/9] trigger --- .github/workflows/templates.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 54d284fb..83016e3e 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -7,13 +7,13 @@ on: branches: - main - devel - - 618_templates_action + - 618_templates_action@devel jobs: templates: name: Check Templates uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@618_templates_action secrets: inherit - #if: github.event_name == 'pull_request' + #if: github.event_name == 'pull_request' with: r-version: "4.1" From e65d4d32bfebf2e6975ff205467e9375557c6753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:06:26 +0200 Subject: [PATCH 5/9] Update templates.yml --- .github/workflows/templates.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 83016e3e..eb90818c 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -17,3 +17,4 @@ jobs: #if: github.event_name == 'pull_request' with: r-version: "4.1" + exclude-templates-data: "adrs_basic.rda" From 08541b0b242c549ec029b98f49f8a95b93313f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:11:55 +0200 Subject: [PATCH 6/9] Update templates.yml --- .github/workflows/templates.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index eb90818c..49b7a251 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -17,4 +17,5 @@ jobs: #if: github.event_name == 'pull_request' with: r-version: "4.1" + push-templates-data: true exclude-templates-data: "adrs_basic.rda" From 1fe25611de42e2af85a0bab84be3c150184665f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:17:38 +0200 Subject: [PATCH 7/9] Update templates.yml --- .github/workflows/templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 49b7a251..55e4ba08 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -18,4 +18,4 @@ jobs: with: r-version: "4.1" push-templates-data: true - exclude-templates-data: "adrs_basic.rda" + exclude-templates-data: "adrs_basic" From cc7dc507ba72a655916274edc242412508c8ed17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Mon, 11 Sep 2023 14:39:10 +0200 Subject: [PATCH 8/9] Update templates.yml --- .github/workflows/templates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 55e4ba08..5d6cada7 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -14,7 +14,7 @@ jobs: name: Check Templates uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@618_templates_action secrets: inherit - #if: github.event_name == 'pull_request' + #if: github.event_name == 'pull_request' with: r-version: "4.1" push-templates-data: true From e7ec3477474e4e29b657075d80af431678301069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Grasselly?= <56442075+dgrassellyb@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:55:54 +0200 Subject: [PATCH 9/9] Update templates.yml --- .github/workflows/templates.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 5d6cada7..f15cbcd7 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -3,18 +3,16 @@ name: Check Templates on: workflow_dispatch: - push: + pull_request: branches: - main - devel - - 618_templates_action@devel jobs: templates: name: Check Templates - uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@618_templates_action + uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main secrets: inherit - #if: github.event_name == 'pull_request' with: r-version: "4.1" push-templates-data: true