From 3918b324fdc1a11122f5f14c6c23027d1036e1b2 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 10:39:38 +0200 Subject: [PATCH 01/62] Update --- .github/workflows/check.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/check.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 00000000..e704d733 --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,24 @@ +--- +name: Check ๐Ÿ›  + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + branches: + - main + push: + branches: + - main + - setup-workflows + workflow_dispatch: + + +# This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created. +jobs: + r-cmd: + name: R CMD Check ๐Ÿงฌ + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main From 7603c7d01f44fa4a53d28852f6cc019699e49226 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 10:51:15 +0200 Subject: [PATCH 02/62] Update --- .github/workflows/check.yaml | 2 +- .github/workflows/simple.yaml | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/simple.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index e704d733..f80cc80b 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,7 +13,7 @@ on: push: branches: - main - - setup-workflows + # - setup-workflows workflow_dispatch: diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml new file mode 100644 index 00000000..a2da48c4 --- /dev/null +++ b/.github/workflows/simple.yaml @@ -0,0 +1,62 @@ +--- +name: Simple workflow + +on: + push: + branches: + - main + # TODO update this + - setup-workflows + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + branches: + - main + +env: + ENABLED_STEPS: "checkout_repository,get_package_name,build_r_package" + +jobs: + hello-world: + runs-on: ubuntu-latest + container: + image: rocker/verse:latest + + steps: + - name: Checkout repo ๐Ÿ›Ž + uses: actions/checkout@v4.1.1 + if: > + contains(env.ENABLED_STEPS, 'checkout_repository') + with: + path: ${{ github.event.repository.name }} + + - name: Get package name ๐Ÿ“ฆ + if: > + contains(env.ENABLED_STEPS, 'get_package_name') + run: | + PKGBUILD="$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)_"\ + "$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION).tar.gz)" + echo "PKGBUILD=$PKGBUILD" + echo "PKGBUILD=$PKGBUILD" >> $GITHUB_ENV + shell: bash + working-directory: ${{ github.event.repository.name }} + + - name: Build R package ๐Ÿ— + if: > + contains(env.ENABLED_STEPS, 'build_r_package') + run: | + R CMD build ${{ github.event.repository.name }} + shell: bash + + - name: Run R CMD check ๐Ÿ + if: > + contains(env.ENABLED_STEPS, 'run_r_cmd_check') + run: | + R CMD check ${{ env.PKGBUILD }} + shell: bash + env: + _R_CHECK_TESTS_NLINES_: 0 + _R_CHECK_VIGNETTES_NLINES_: 0 From 01c7ddd71caddb1938561506dd12bfe7963c3dbd Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 10:56:00 +0200 Subject: [PATCH 03/62] Update --- .github/workflows/simple.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index a2da48c4..d400d4d7 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -17,13 +17,13 @@ on: - main env: - ENABLED_STEPS: "checkout_repository,get_package_name,build_r_package" + ENABLED_STEPS: "checkout_repository,get_package_name,build_r_package,run_r_cmd_check" jobs: hello-world: runs-on: ubuntu-latest container: - image: rocker/verse:latest + image: rocker/r-ubuntu:latest steps: - name: Checkout repo ๐Ÿ›Ž @@ -39,7 +39,7 @@ jobs: run: | PKGBUILD="$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)_"\ "$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION).tar.gz)" - echo "PKGBUILD=$PKGBUILD" + echo "PKGBUILD = $PKGBUILD" echo "PKGBUILD=$PKGBUILD" >> $GITHUB_ENV shell: bash working-directory: ${{ github.event.repository.name }} From 5a55bbcea2b27739b9df63bdb8896b4ca5632eb8 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 10:58:27 +0200 Subject: [PATCH 04/62] Update --- .github/workflows/check.yaml | 16 ++++++++-------- .github/workflows/simple.yaml | 17 +++++++++++------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index f80cc80b..8b62ae2f 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -2,14 +2,14 @@ name: Check ๐Ÿ›  on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - branches: - - main + # pull_request: + # types: + # - opened + # - synchronize + # - reopened + # - ready_for_review + # branches: + # - main push: branches: - main diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index d400d4d7..4c24b66f 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -7,12 +7,12 @@ on: - main # TODO update this - setup-workflows - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review + # pull_request: + # types: + # - opened + # - synchronize + # - reopened + # - ready_for_review branches: - main @@ -51,6 +51,11 @@ jobs: R CMD build ${{ github.event.repository.name }} shell: bash + - name: Install packages + run: + install.packages(c("cli", "testthat")) + shell: Rscript {0} + - name: Run R CMD check ๐Ÿ if: > contains(env.ENABLED_STEPS, 'run_r_cmd_check') From caf7a357497218aef7ffcb68b171727b40a73ea8 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 10:59:35 +0200 Subject: [PATCH 05/62] Update --- .github/workflows/simple.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 4c24b66f..c2f9e211 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -13,8 +13,8 @@ on: # - synchronize # - reopened # - ready_for_review - branches: - - main + # branches: + # - main env: ENABLED_STEPS: "checkout_repository,get_package_name,build_r_package,run_r_cmd_check" From 357b2972438f81f9be94e07ed5ebe4f0860a2e9e Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 11:08:49 +0200 Subject: [PATCH 06/62] Update --- .github/workflows/simple.yaml | 51 +++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index c2f9e211..d74d912e 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -16,26 +16,42 @@ on: # branches: # - main +# For reference, this is how the full list of steps will look like: +# +#env: +# ENABLED_STEPS: | +# checkout_repository +# get_package_name +# build_r_package +# run_r_cmd_check +# upload_artifact + +# Please set this variable to include proper steps. env: - ENABLED_STEPS: "checkout_repository,get_package_name,build_r_package,run_r_cmd_check" + ENABLED_STEPS: | + checkout_repository + get_package_name + build_r_package + run_r_cmd_check + upload_artifact jobs: hello-world: runs-on: ubuntu-latest container: - image: rocker/r-ubuntu:latest + # image: rocker/r-ubuntu:latest + image: rocker/tidyverse:4.4.0 steps: - name: Checkout repo ๐Ÿ›Ž + # This means we're actually using a GitHub Action. uses: actions/checkout@v4.1.1 - if: > - contains(env.ENABLED_STEPS, 'checkout_repository') + if: contains(env.ENABLED_STEPS, 'checkout_repository') with: path: ${{ github.event.repository.name }} - name: Get package name ๐Ÿ“ฆ - if: > - contains(env.ENABLED_STEPS, 'get_package_name') + if: contains(env.ENABLED_STEPS, 'get_package_name') run: | PKGBUILD="$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)_"\ "$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION).tar.gz)" @@ -45,23 +61,30 @@ jobs: working-directory: ${{ github.event.repository.name }} - name: Build R package ๐Ÿ— - if: > - contains(env.ENABLED_STEPS, 'build_r_package') + if: contains(env.ENABLED_STEPS, 'build_r_package') run: | R CMD build ${{ github.event.repository.name }} shell: bash - - name: Install packages - run: - install.packages(c("cli", "testthat")) - shell: Rscript {0} + # TODO Decide if we use an image with these packages installed, + # or we want to show how to install them (takes 2-3 minutes). + # - name: Install packages + # run: + # install.packages(c("cli", "testthat")) + # shell: Rscript {0} - name: Run R CMD check ๐Ÿ - if: > - contains(env.ENABLED_STEPS, 'run_r_cmd_check') + if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | R CMD check ${{ env.PKGBUILD }} shell: bash env: _R_CHECK_TESTS_NLINES_: 0 _R_CHECK_VIGNETTES_NLINES_: 0 + + - name: Upload package build โคด + if: contains(env.ENABLED_STEPS, 'upload_artifact') + uses: actions/upload-artifact@v4 + with: + path: ${{ github.event.repository.name }}/${{ env.PKGBUILD }} + name: ${{ env.PKGBUILD }} From 9a75faef332f3f39f64a24f5a155dab80cf8c593 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 11:10:33 +0200 Subject: [PATCH 07/62] Update --- .github/workflows/simple.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index d74d912e..2d87303d 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest container: # image: rocker/r-ubuntu:latest - image: rocker/tidyverse:4.4.0 + image: rocker/verse:4.4.0 steps: - name: Checkout repo ๐Ÿ›Ž @@ -68,6 +68,7 @@ jobs: # TODO Decide if we use an image with these packages installed, # or we want to show how to install them (takes 2-3 minutes). + # Additionally, LaTeX is needed to create manual. # - name: Install packages # run: # install.packages(c("cli", "testthat")) From 2afaa9ef23302ee0317b49ff23e793a79001bbdf Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 11:12:13 +0200 Subject: [PATCH 08/62] Update --- .Rbuildignore | 1 + .github/workflows/simple.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.Rbuildignore b/.Rbuildignore index 6627b846..6c47ed1e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ ^r\.package\.example\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ +^.github$ diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 2d87303d..cf14453c 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -16,6 +16,9 @@ on: # branches: # - main +# To make sure you can run this workflow in your forked repository, please go to: +# Actions and click I understand my workflows... + # For reference, this is how the full list of steps will look like: # #env: From 7cf90b6f3107cf6b65579e3b17a1cdcd88d95b64 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 11:13:33 +0200 Subject: [PATCH 09/62] Update --- .github/workflows/simple.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index cf14453c..28e4e90a 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -35,8 +35,6 @@ env: checkout_repository get_package_name build_r_package - run_r_cmd_check - upload_artifact jobs: hello-world: From 4f97b7c5db70f72bbd24b88b8d108015a2eb3192 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 12:27:11 +0200 Subject: [PATCH 10/62] Update --- .github/workflows/simple.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 28e4e90a..692ed209 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -20,6 +20,7 @@ on: # Actions and click I understand my workflows... # For reference, this is how the full list of steps will look like: +# Remove just a single # character at the beginning of line to uncomment. # #env: # ENABLED_STEPS: | @@ -45,7 +46,7 @@ jobs: steps: - name: Checkout repo ๐Ÿ›Ž - # This means we're actually using a GitHub Action. + # This means we're actually using an official GitHub Action. uses: actions/checkout@v4.1.1 if: contains(env.ENABLED_STEPS, 'checkout_repository') with: @@ -54,8 +55,7 @@ jobs: - name: Get package name ๐Ÿ“ฆ if: contains(env.ENABLED_STEPS, 'get_package_name') run: | - PKGBUILD="$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)_"\ - "$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION).tar.gz)" + PKGBUILD="$(Rscript -e 'cat(sprintf("%s_%s.tar.gz",(dcf <- read.dcf("DESCRIPTION"))[,"Package"], dcf[,"Version"]))')" echo "PKGBUILD = $PKGBUILD" echo "PKGBUILD=$PKGBUILD" >> $GITHUB_ENV shell: bash @@ -69,7 +69,8 @@ jobs: # TODO Decide if we use an image with these packages installed, # or we want to show how to install them (takes 2-3 minutes). - # Additionally, LaTeX is needed to create manual. + # Additionally, LaTeX is needed to create manual, + # so rocker/verse is working well for this purpose. # - name: Install packages # run: # install.packages(c("cli", "testthat")) @@ -78,7 +79,7 @@ jobs: - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | - R CMD check ${{ env.PKGBUILD }} + R CMD check ${{ env.PKGBUILD }} shell: bash env: _R_CHECK_TESTS_NLINES_: 0 From 0130477986de9b0765ef6ae2cab79842ae7a8cd0 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 12:54:38 +0200 Subject: [PATCH 11/62] Update --- .github/workflows/simple.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 692ed209..e6ed9792 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -38,7 +38,17 @@ env: build_r_package jobs: - hello-world: + hello-world-from-r: + runs-on: ubuntu-latest + steps: + - name: Setup R ๐Ÿ”ง + uses: r-lib/actions/setup-r@v2 + + - name: Hello world! ๐Ÿ’ฌ + run: cat("Hello world from R! ๐Ÿ‘‹") + shell: Rscript {0} + + build-r-package: runs-on: ubuntu-latest container: # image: rocker/r-ubuntu:latest From d98567b3fd8fdc4e82390ae3b1c4e2babfd7eaba Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 12:59:38 +0200 Subject: [PATCH 12/62] Update --- .github/workflows/simple.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index e6ed9792..5f72899f 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -33,9 +33,8 @@ on: # Please set this variable to include proper steps. env: ENABLED_STEPS: | - checkout_repository - get_package_name - build_r_package + None for now, when asked to, please add the steps from above, like this: + step_name_from_above (four spaces before the step name are important!) jobs: hello-world-from-r: @@ -45,8 +44,10 @@ jobs: uses: r-lib/actions/setup-r@v2 - name: Hello world! ๐Ÿ’ฌ - run: cat("Hello world from R! ๐Ÿ‘‹") + run: cat(paste0("Hello ", Sys.getenv("NAME"), "! ๐Ÿ‘‹")) shell: Rscript {0} + env: + NAME: "Your name" build-r-package: runs-on: ubuntu-latest From b93d996aec7cd5066037641b4c9aca3d0ff83565 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 13:02:00 +0200 Subject: [PATCH 13/62] Update --- .github/workflows/simple.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 5f72899f..46c49354 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -35,6 +35,9 @@ env: ENABLED_STEPS: | None for now, when asked to, please add the steps from above, like this: step_name_from_above (four spaces before the step name are important!) + checkout_repository + get_package_name + build_r_package jobs: hello-world-from-r: From d13fb242eed0f1c6523687912858d9d6c6249e29 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 13:03:36 +0200 Subject: [PATCH 14/62] Update --- .github/workflows/simple.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 46c49354..147d229a 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -38,6 +38,7 @@ env: checkout_repository get_package_name build_r_package + upload_artifact jobs: hello-world-from-r: From bb038405f207e86f6573a762fc1d35acbb74d88c Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 13:05:22 +0200 Subject: [PATCH 15/62] Update --- .github/workflows/simple.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 147d229a..f4c830b0 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -80,6 +80,7 @@ jobs: if: contains(env.ENABLED_STEPS, 'build_r_package') run: | R CMD build ${{ github.event.repository.name }} + ls -l shell: bash # TODO Decide if we use an image with these packages installed, @@ -104,5 +105,5 @@ jobs: if: contains(env.ENABLED_STEPS, 'upload_artifact') uses: actions/upload-artifact@v4 with: - path: ${{ github.event.repository.name }}/${{ env.PKGBUILD }} + path: ${{ env.PKGBUILD }} name: ${{ env.PKGBUILD }} From e697b68f401246b032477f893407d65cbf015879 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 15 May 2024 13:07:36 +0200 Subject: [PATCH 16/62] Update --- .github/workflows/simple.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index f4c830b0..a8e4508e 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -42,6 +42,7 @@ env: jobs: hello-world-from-r: + name: Hello, world! runs-on: ubuntu-latest steps: - name: Setup R ๐Ÿ”ง @@ -54,6 +55,7 @@ jobs: NAME: "Your name" build-r-package: + name: Build R package runs-on: ubuntu-latest container: # image: rocker/r-ubuntu:latest From 93d8cecebe0ec0122cd1c6a7b705506313710d61 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 10:58:47 +0200 Subject: [PATCH 17/62] Update --- .github/workflows/check.yaml | 5 ++++- .github/workflows/simple.yaml | 26 +++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8b62ae2f..9cb7756a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,7 +13,7 @@ on: push: branches: - main - # - setup-workflows + - setup-workflows workflow_dispatch: @@ -22,3 +22,6 @@ jobs: r-cmd: name: R CMD Check ๐Ÿงฌ uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main + validation: + name: R Package Validation report ๐Ÿ“ƒ + uses: insightsengineering/r.pkg.template/.github/workflows/validation.yaml@main diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index a8e4508e..56dd61c6 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -19,26 +19,22 @@ on: # To make sure you can run this workflow in your forked repository, please go to: # Actions and click I understand my workflows... -# For reference, this is how the full list of steps will look like: -# Remove just a single # character at the beginning of line to uncomment. -# -#env: -# ENABLED_STEPS: | -# checkout_repository -# get_package_name -# build_r_package -# run_r_cmd_check -# upload_artifact +# env: +# ENABLED_STEPS: | +# checkout_repository +# get_package_name +# build_r_package +# run_r_cmd_check +# upload_artifact -# Please set this variable to include proper steps. +# When asked to, please add the steps from the list above: env: ENABLED_STEPS: | - None for now, when asked to, please add the steps from above, like this: - step_name_from_above (four spaces before the step name are important!) checkout_repository get_package_name - build_r_package - upload_artifact + build_r_... + run_r_... + upload_... jobs: hello-world-from-r: From fdcf33b01440132930613cb26a40a3df042631f3 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 11:01:29 +0200 Subject: [PATCH 18/62] Update --- .github/workflows/simple.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 56dd61c6..240cf74b 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -18,6 +18,7 @@ on: # To make sure you can run this workflow in your forked repository, please go to: # Actions and click I understand my workflows... +# Settings -> Actions -> General -> Workflow permissions -> Read and write permissions # env: # ENABLED_STEPS: | From 07f0815358417ada9d0b96561eb5da8072fa99a9 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 11:02:00 +0200 Subject: [PATCH 19/62] Update --- .github/workflows/simple.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 240cf74b..fe8280c5 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -16,8 +16,8 @@ on: # branches: # - main -# To make sure you can run this workflow in your forked repository, please go to: -# Actions and click I understand my workflows... +# Prerequisites to run workflows: +# Actions -> I understand my workflows... # Settings -> Actions -> General -> Workflow permissions -> Read and write permissions # env: From 9e6a0d486a064f9faaa8aa177b3ec2ad28ce9128 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 12:26:09 +0200 Subject: [PATCH 20/62] Update --- .github/workflows/check.yaml | 3 --- .github/workflows/simple.yaml | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 9cb7756a..108f8917 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -22,6 +22,3 @@ jobs: r-cmd: name: R CMD Check ๐Ÿงฌ uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main - validation: - name: R Package Validation report ๐Ÿ“ƒ - uses: insightsengineering/r.pkg.template/.github/workflows/validation.yaml@main diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index fe8280c5..d2fb058b 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -31,8 +31,9 @@ on: # When asked to, please add the steps from the list above: env: ENABLED_STEPS: | - checkout_repository - get_package_name + build_and_check + checkout_... + get_package_... build_r_... run_r_... upload_... @@ -51,9 +52,10 @@ jobs: env: NAME: "Your name" - build-r-package: + build-and-check: name: Build R package runs-on: ubuntu-latest + if: contains(env.ENABLED_STEPS, 'build_and_check') container: # image: rocker/r-ubuntu:latest image: rocker/verse:4.4.0 From e7336660ba0322da4ec47ebd0a9e087a199c974c Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 12:29:17 +0200 Subject: [PATCH 21/62] Update --- .github/workflows/simple.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index d2fb058b..82954765 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -55,7 +55,8 @@ jobs: build-and-check: name: Build R package runs-on: ubuntu-latest - if: contains(env.ENABLED_STEPS, 'build_and_check') + if: > + contains(env.ENABLED_STEPS, 'build_and_check') container: # image: rocker/r-ubuntu:latest image: rocker/verse:4.4.0 From fbb5757c3dd2656cb4c240b00558fce6870d98d5 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 12:33:34 +0200 Subject: [PATCH 22/62] Update --- .github/workflows/simple.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 82954765..617ef561 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -31,7 +31,6 @@ on: # When asked to, please add the steps from the list above: env: ENABLED_STEPS: | - build_and_check checkout_... get_package_... build_r_... @@ -55,8 +54,6 @@ jobs: build-and-check: name: Build R package runs-on: ubuntu-latest - if: > - contains(env.ENABLED_STEPS, 'build_and_check') container: # image: rocker/r-ubuntu:latest image: rocker/verse:4.4.0 From a2dd35f812e883c92411dabc7fe075ecc535062a Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 12:58:28 +0200 Subject: [PATCH 23/62] Update --- .github/workflows/simple.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 617ef561..007f916a 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -106,3 +106,7 @@ jobs: with: path: ${{ env.PKGBUILD }} name: ${{ env.PKGBUILD }} + + call-reusable-workflow: + name: Reusable workflow โ™ป๏ธ + uses: user-workshop-cicd/r.pkg.template/.github/workflows/sample-reusable-workflow.yaml@example-reusable-workflow From 09e5dd492847a6e0984502801dadedecff041e58 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 12:59:16 +0200 Subject: [PATCH 24/62] Update --- .github/workflows/simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 007f916a..26c94b92 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -109,4 +109,4 @@ jobs: call-reusable-workflow: name: Reusable workflow โ™ป๏ธ - uses: user-workshop-cicd/r.pkg.template/.github/workflows/sample-reusable-workflow.yaml@example-reusable-workflow + uses: user-workshop-cicd/r.pkg.template/.github/workflows/sample-reusable-workflow.yaml@sample-reusable-workflow From cae6d4307b233afa7c191331821e971ad52670a0 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 13:00:21 +0200 Subject: [PATCH 25/62] Empty From 45817d23b61ebda4bdb577b996ade08f60d6dfb4 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 13:07:40 +0200 Subject: [PATCH 26/62] Update --- .github/workflows/check.yaml | 2 +- .github/workflows/simple.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 108f8917..8b62ae2f 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,7 +13,7 @@ on: push: branches: - main - - setup-workflows + # - setup-workflows workflow_dispatch: diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 26c94b92..626ed18b 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -110,3 +110,5 @@ jobs: call-reusable-workflow: name: Reusable workflow โ™ป๏ธ uses: user-workshop-cicd/r.pkg.template/.github/workflows/sample-reusable-workflow.yaml@sample-reusable-workflow + with: + name: Octocat From 47b6b1fdfeb362ae0cfc6e33efc79c75010c3a7c Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 13:09:48 +0200 Subject: [PATCH 27/62] Update --- .github/workflows/simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 626ed18b..a005c6dc 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -111,4 +111,4 @@ jobs: name: Reusable workflow โ™ป๏ธ uses: user-workshop-cicd/r.pkg.template/.github/workflows/sample-reusable-workflow.yaml@sample-reusable-workflow with: - name: Octocat + name: Not an Octocat From aa670c9a4a190682bff6b7fb159a9f68e7445110 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 13:11:10 +0200 Subject: [PATCH 28/62] Empty From 7065f54d19484ac563a98415300b42f2ad23b8cd Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 13:11:59 +0200 Subject: [PATCH 29/62] Empty From 4d83660d6c20dac9993e8a5469c0b1837f6a31f1 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 21 May 2024 16:34:04 +0200 Subject: [PATCH 30/62] Update --- .github/workflows/simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index a005c6dc..626ed18b 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -111,4 +111,4 @@ jobs: name: Reusable workflow โ™ป๏ธ uses: user-workshop-cicd/r.pkg.template/.github/workflows/sample-reusable-workflow.yaml@sample-reusable-workflow with: - name: Not an Octocat + name: Octocat From 763b2c97bfc52134bbe4991d1ef1995eb7a95fa8 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 22 May 2024 10:11:00 +0200 Subject: [PATCH 31/62] Update --- .github/workflows/check.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8b62ae2f..23528d88 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -19,6 +19,20 @@ on: # This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created. jobs: + job-setup: + name: Should we run R CMD check? + runs-on: ubuntu-latest + outputs: + check_out: ${{ steps.check.outputs.run_r_cmd_check }} + steps: + - name: To check or not to check? + id: check + run: | + echo "run_r_cmd_check=true" >> $GITHUB_OUTPUT + r-cmd: name: R CMD Check ๐Ÿงฌ + needs: job-setup uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main + if: > + needs.job-setup.outputs.check_out == 'true' From 36f89c45546d976ff05bb4670459da6ec8d28063 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 22 May 2024 10:12:02 +0200 Subject: [PATCH 32/62] Update --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 23528d88..aca39ef5 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,7 +13,7 @@ on: push: branches: - main - # - setup-workflows + - setup-workflows workflow_dispatch: From 04fc181ad70b5deafa1aa466b7f87f4bc5642e65 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Wed, 22 May 2024 10:13:23 +0200 Subject: [PATCH 33/62] Update --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index aca39ef5..0a6743f3 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -28,7 +28,7 @@ jobs: - name: To check or not to check? id: check run: | - echo "run_r_cmd_check=true" >> $GITHUB_OUTPUT + echo "run_r_cmd_check=false" >> $GITHUB_OUTPUT r-cmd: name: R CMD Check ๐Ÿงฌ From fc85dac12e793031a81318459d71d8089eebb950 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:23:58 +0200 Subject: [PATCH 34/62] Update --- .github/workflows/simple.yaml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 626ed18b..9cd46443 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -54,13 +54,9 @@ jobs: build-and-check: name: Build R package runs-on: ubuntu-latest - container: - # image: rocker/r-ubuntu:latest - image: rocker/verse:4.4.0 - steps: - name: Checkout repo ๐Ÿ›Ž - # This means we're actually using an official GitHub Action. + # We're using an official GitHub Action. uses: actions/checkout@v4.1.1 if: contains(env.ENABLED_STEPS, 'checkout_repository') with: @@ -82,15 +78,6 @@ jobs: ls -l shell: bash - # TODO Decide if we use an image with these packages installed, - # or we want to show how to install them (takes 2-3 minutes). - # Additionally, LaTeX is needed to create manual, - # so rocker/verse is working well for this purpose. - # - name: Install packages - # run: - # install.packages(c("cli", "testthat")) - # shell: Rscript {0} - - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | From 91f2c0537cfb9a6089bb2cec9fb2a101f32b76cc Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:26:35 +0200 Subject: [PATCH 35/62] Update --- .github/workflows/simple.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 9cd46443..1d8cc87f 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -62,6 +62,14 @@ jobs: with: path: ${{ github.event.repository.name }} + - name: Setup R ๐Ÿ”ง + if: contains(env.ENABLED_STEPS, 'setup_r') + uses: r-lib/actions/setup-r@v2 + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + - name: Get package name ๐Ÿ“ฆ if: contains(env.ENABLED_STEPS, 'get_package_name') run: | From 3beb5f9619406b6c85a19e92c0dfe54145e9f7c5 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:28:03 +0200 Subject: [PATCH 36/62] Update --- .github/workflows/simple.yaml | 36 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 1d8cc87f..49c423e6 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -20,22 +20,26 @@ on: # Actions -> I understand my workflows... # Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -# env: -# ENABLED_STEPS: | -# checkout_repository -# get_package_name -# build_r_package -# run_r_cmd_check -# upload_artifact - -# When asked to, please add the steps from the list above: env: ENABLED_STEPS: | - checkout_... - get_package_... - build_r_... - run_r_... - upload_... + checkout_repository + setup_r + setup_dependencies + get_package_name + build_r_package + run_r_cmd_check + upload_artifact + +# When asked to, please add the steps from the list above: +# env: +# ENABLED_STEPS: | +# checkout_... +# setup_... +# setup_... +# get_package_... +# build_r_... +# run_r_... +# upload_... jobs: hello-world-from-r: @@ -66,7 +70,9 @@ jobs: if: contains(env.ENABLED_STEPS, 'setup_r') uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 + - name: Setup R dependencies ๐Ÿ”ง + uses: r-lib/actions/setup-r-dependencies@v2 + if: contains(env.ENABLED_STEPS, 'setup_dependencies') with: extra-packages: any::rcmdcheck From a1d982de34a6e805145af51c62a7972a4fa6051c Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:32:59 +0200 Subject: [PATCH 37/62] Update --- .github/workflows/simple.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 49c423e6..c6589e34 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -64,6 +64,9 @@ jobs: uses: actions/checkout@v4.1.1 if: contains(env.ENABLED_STEPS, 'checkout_repository') with: + # Action inputs (arguments/parameters). + # In this case we clone the repository to the directory called the same + # as the repository name. path: ${{ github.event.repository.name }} - name: Setup R ๐Ÿ”ง @@ -75,7 +78,10 @@ jobs: if: contains(env.ENABLED_STEPS, 'setup_dependencies') with: extra-packages: any::rcmdcheck + working-directory: ${{ github.event.repository.name }} + # Get package name and version from DESCRIPTION so that we'll know + # what's the name of the tar.gz file with the built package. - name: Get package name ๐Ÿ“ฆ if: contains(env.ENABLED_STEPS, 'get_package_name') run: | @@ -85,6 +91,7 @@ jobs: shell: bash working-directory: ${{ github.event.repository.name }} + # Build a package stored in a directory called ${{ github.event.repository.name }} - name: Build R package ๐Ÿ— if: contains(env.ENABLED_STEPS, 'build_r_package') run: | @@ -92,6 +99,7 @@ jobs: ls -l shell: bash + # Check tar.gz package built in previous step. - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | @@ -101,6 +109,7 @@ jobs: _R_CHECK_TESTS_NLINES_: 0 _R_CHECK_VIGNETTES_NLINES_: 0 + # Upload tar.gz package as an artifact so it can be downloaded. - name: Upload package build โคด if: contains(env.ENABLED_STEPS, 'upload_artifact') uses: actions/upload-artifact@v4 From 05c077b699a11b63e8910979d4f3c85a0de36cce Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:33:37 +0200 Subject: [PATCH 38/62] Update --- .github/workflows/simple.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index c6589e34..7054999f 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -78,7 +78,7 @@ jobs: if: contains(env.ENABLED_STEPS, 'setup_dependencies') with: extra-packages: any::rcmdcheck - working-directory: ${{ github.event.repository.name }} + working-directory: ${{ github.event.repository.name }} # Get package name and version from DESCRIPTION so that we'll know # what's the name of the tar.gz file with the built package. From c80254c90d74941442eb0a967dd8e851f65ca912 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:41:49 +0200 Subject: [PATCH 39/62] Update --- .github/workflows/check.yaml | 1 + .github/workflows/simple.yaml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 0a6743f3..34df66bd 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -33,6 +33,7 @@ jobs: r-cmd: name: R CMD Check ๐Ÿงฌ needs: job-setup + # Call a workflow from a given GitHub repository, from a given branch (or tag). uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main if: > needs.job-setup.outputs.check_out == 'true' diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 7054999f..fcc3574e 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -82,6 +82,8 @@ jobs: # Get package name and version from DESCRIPTION so that we'll know # what's the name of the tar.gz file with the built package. + # PKGBUILD environment variable is saved as an environment variable so this + # information can be accessed by subsequent steps. - name: Get package name ๐Ÿ“ฆ if: contains(env.ENABLED_STEPS, 'get_package_name') run: | @@ -95,7 +97,7 @@ jobs: - name: Build R package ๐Ÿ— if: contains(env.ENABLED_STEPS, 'build_r_package') run: | - R CMD build ${{ github.event.repository.name }} + R CMD build --no-manual --no-build-vignettes ${{ github.event.repository.name }} ls -l shell: bash @@ -103,7 +105,7 @@ jobs: - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | - R CMD check ${{ env.PKGBUILD }} + R CMD check --no-manual --no-vignettes ${{ env.PKGBUILD }} shell: bash env: _R_CHECK_TESTS_NLINES_: 0 From b1f73cf996d68cae800136d4585dfbf5fd0c8b15 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:47:11 +0200 Subject: [PATCH 40/62] Update --- tests/testthat/test-hello.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-hello.R b/tests/testthat/test-hello.R index 0b2fa257..289310c5 100644 --- a/tests/testthat/test-hello.R +++ b/tests/testthat/test-hello.R @@ -7,5 +7,5 @@ test_that("hello_cli() works", { }) test_that("fix me!!!", { - expect_equal(1, 2) -}) \ No newline at end of file + expect_equal(1, 1) +}) From 116e2740bbda6ef191695d5d233b655cab846750 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 11:55:47 +0200 Subject: [PATCH 41/62] Update --- .github/workflows/check.yaml | 22 ++++++++++++---------- .github/workflows/simple.yaml | 26 ++++++++++++++++---------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 34df66bd..8b2c3d9a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -2,20 +2,22 @@ name: Check ๐Ÿ›  on: - # pull_request: - # types: - # - opened - # - synchronize - # - reopened - # - ready_for_review - # branches: - # - main + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + branches: + - main push: branches: - main - - setup-workflows - workflow_dispatch: +# Prerequisites to run workflows: +# Actions -> I understand my workflows... +# Settings -> Actions -> General -> Workflow permissions -> Read and write permissions +# Create a PR from your own branch to main. # This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created. jobs: diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index fcc3574e..65394b10 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -2,23 +2,22 @@ name: Simple workflow on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + branches: + - main push: branches: - main - # TODO update this - - setup-workflows - # pull_request: - # types: - # - opened - # - synchronize - # - reopened - # - ready_for_review - # branches: - # - main # Prerequisites to run workflows: # Actions -> I understand my workflows... # Settings -> Actions -> General -> Workflow permissions -> Read and write permissions +# Create a PR from your own branch to main. env: ENABLED_STEPS: | @@ -42,6 +41,7 @@ env: # upload_... jobs: + # First job. hello-world-from-r: name: Hello, world! runs-on: ubuntu-latest @@ -55,6 +55,8 @@ jobs: env: NAME: "Your name" + # Second job - by default jobs will run in parallel, unless some dependencies + # are introduced between them. build-and-check: name: Build R package runs-on: ubuntu-latest @@ -71,9 +73,11 @@ jobs: - name: Setup R ๐Ÿ”ง if: contains(env.ENABLED_STEPS, 'setup_r') + # We're using a third-party GitHub Action. uses: r-lib/actions/setup-r@v2 - name: Setup R dependencies ๐Ÿ”ง + # We're using a third-party GitHub Action. uses: r-lib/actions/setup-r-dependencies@v2 if: contains(env.ENABLED_STEPS, 'setup_dependencies') with: @@ -94,6 +98,7 @@ jobs: working-directory: ${{ github.event.repository.name }} # Build a package stored in a directory called ${{ github.event.repository.name }} + # --no-manual --no-build-vignettes because this requires LaTeX. - name: Build R package ๐Ÿ— if: contains(env.ENABLED_STEPS, 'build_r_package') run: | @@ -102,6 +107,7 @@ jobs: shell: bash # Check tar.gz package built in previous step. + # --no-manual --no-vignettes because this requires LaTeX. - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | From 9d59f468c5c63cdb2f23c69539a8a4a1638f33f7 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 12:28:04 +0200 Subject: [PATCH 42/62] Update --- .github/workflows/simple.yaml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 65394b10..465399eb 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -42,18 +42,19 @@ env: jobs: # First job. - hello-world-from-r: - name: Hello, world! - runs-on: ubuntu-latest - steps: - - name: Setup R ๐Ÿ”ง - uses: r-lib/actions/setup-r@v2 + # TODO uncomment + # hello-world-from-r: + # name: Hello, world! + # runs-on: ubuntu-latest + # steps: + # - name: Setup R ๐Ÿ”ง + # uses: r-lib/actions/setup-r@v2 - - name: Hello world! ๐Ÿ’ฌ - run: cat(paste0("Hello ", Sys.getenv("NAME"), "! ๐Ÿ‘‹")) - shell: Rscript {0} - env: - NAME: "Your name" + # - name: Hello world! ๐Ÿ’ฌ + # run: cat(paste0("Hello ", Sys.getenv("NAME"), "! ๐Ÿ‘‹")) + # shell: Rscript {0} + # env: + # NAME: "Your name" # Second job - by default jobs will run in parallel, unless some dependencies # are introduced between them. @@ -117,13 +118,19 @@ jobs: _R_CHECK_TESTS_NLINES_: 0 _R_CHECK_VIGNETTES_NLINES_: 0 + - name: Get tar.gz file name + id: tar-gz + uses: user-workshop-cicd/action-example@setup-action + with: + filename-beginning: ${{ github.event.repository.name }} + # Upload tar.gz package as an artifact so it can be downloaded. - name: Upload package build โคด if: contains(env.ENABLED_STEPS, 'upload_artifact') uses: actions/upload-artifact@v4 with: - path: ${{ env.PKGBUILD }} - name: ${{ env.PKGBUILD }} + path: ${{ steps.tar-gz.outputs.full-filename }} + name: ${{ steps.tar-gz.outputs.full-filename }} call-reusable-workflow: name: Reusable workflow โ™ป๏ธ From 36acdadbd0ca004f800cc4267fb094d33d8b8da0 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 12:31:33 +0200 Subject: [PATCH 43/62] Update --- .github/workflows/simple.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 465399eb..f3af4cc4 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -119,7 +119,9 @@ jobs: _R_CHECK_VIGNETTES_NLINES_: 0 - name: Get tar.gz file name + if: contains(env.ENABLED_STEPS, 'upload_artifact') id: tar-gz + # Use our custom action. uses: user-workshop-cicd/action-example@setup-action with: filename-beginning: ${{ github.event.repository.name }} @@ -129,6 +131,8 @@ jobs: if: contains(env.ENABLED_STEPS, 'upload_artifact') uses: actions/upload-artifact@v4 with: + # Output of the custom action from the previous step + # are inputs of this action. path: ${{ steps.tar-gz.outputs.full-filename }} name: ${{ steps.tar-gz.outputs.full-filename }} From 862e70a96e769c840b4f247fb105cf2dc818f5f9 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 12:33:08 +0200 Subject: [PATCH 44/62] Update --- tests/testthat/test-hello.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-hello.R b/tests/testthat/test-hello.R index 289310c5..e3cfab2a 100644 --- a/tests/testthat/test-hello.R +++ b/tests/testthat/test-hello.R @@ -7,5 +7,5 @@ test_that("hello_cli() works", { }) test_that("fix me!!!", { - expect_equal(1, 1) + expect_equal(1, 2) }) From 1b0915fdd89b89fa8045f2324ad558352aa2d715 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Thu, 23 May 2024 12:35:58 +0200 Subject: [PATCH 45/62] Update --- .github/workflows/simple.yaml | 59 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index f3af4cc4..26e18b35 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -19,42 +19,41 @@ on: # Settings -> Actions -> General -> Workflow permissions -> Read and write permissions # Create a PR from your own branch to main. -env: - ENABLED_STEPS: | - checkout_repository - setup_r - setup_dependencies - get_package_name - build_r_package - run_r_cmd_check - upload_artifact - -# When asked to, please add the steps from the list above: # env: # ENABLED_STEPS: | -# checkout_... -# setup_... -# setup_... -# get_package_... -# build_r_... -# run_r_... -# upload_... +# checkout_repository +# setup_r +# setup_dependencies +# get_package_name +# build_r_package +# run_r_cmd_check +# upload_artifact + +# When asked to, please add the steps from the list above: +env: + ENABLED_STEPS: | + checkout_... + setup_... + setup_... + get_package_... + build_r_... + run_r_... + upload_... jobs: # First job. - # TODO uncomment - # hello-world-from-r: - # name: Hello, world! - # runs-on: ubuntu-latest - # steps: - # - name: Setup R ๐Ÿ”ง - # uses: r-lib/actions/setup-r@v2 + hello-world-from-r: + name: Hello, world! + runs-on: ubuntu-latest + steps: + - name: Setup R ๐Ÿ”ง + uses: r-lib/actions/setup-r@v2 - # - name: Hello world! ๐Ÿ’ฌ - # run: cat(paste0("Hello ", Sys.getenv("NAME"), "! ๐Ÿ‘‹")) - # shell: Rscript {0} - # env: - # NAME: "Your name" + - name: Hello world! ๐Ÿ’ฌ + run: cat(paste0("Hello ", Sys.getenv("NAME"), "! ๐Ÿ‘‹")) + shell: Rscript {0} + env: + NAME: "Your name" # Second job - by default jobs will run in parallel, unless some dependencies # are introduced between them. From 1fe72e6612f9a4dda912916cee5f5949cfd4d3cd Mon Sep 17 00:00:00 2001 From: walkowif Date: Fri, 24 May 2024 12:34:17 +0000 Subject: [PATCH 46/62] Empty test From cd801db5270a5e58f663c091568bd17bc7e5f477 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Fri, 24 May 2024 14:39:20 +0200 Subject: [PATCH 47/62] Add instructions to README --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index c7886d4a..d609dc14 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,52 @@ # r.package.example An example package for the workshop. + +## Setting up local environment + +You'll need an SSH client and `git`. + +For example on Ubuntu, you can install them like this. If you know how to use Docker, you can run these commands in `ubuntu` image. +```bash +apt-get update && apt-get install -yq openssh-client git +``` + +Create an SSH key pair. +```bash +ssh-keygen -P '' -t rsa -b 4096 -C "$(whoami)@$(hostname)" -f ~/.ssh/$(whoami)-github +eval $(ssh-agent) && ssh-add ~/.ssh/$(whoami)-github +cat ~/.ssh/$(whoami)-github.pub +``` + +The result will look like this: +``` +ssh-rsa AAAA... +``` + +Copy this and paste to https://github.com/settings/ssh/new. + +Add any title, and leave key type equal to authentication key. + +### Cloning the sample repository + +Clone the `r.package.example` repository. Replace `` with an URL similar to this one: `git@github.com:user-workshop-cicd/r.package.example.git`, but `user-workshop-cicd` should be replaced with your GitHub username. + +```bash +git clone +cd r.package.example +git status +``` + +The output should look like: +``` +On branch main +Your branch is up to date with 'origin/main'. + +nothing to commit, working tree clean +``` + +Configure your name and email address - this will be required to push commits. +``` +git config --global user.email "you@example.com" +git config --global user.name "Your Name" +``` From 41b2a2838eb3c5e25aa22e64335e42da27b54e9d Mon Sep 17 00:00:00 2001 From: walkowif Date: Mon, 27 May 2024 10:51:00 +0200 Subject: [PATCH 48/62] Empty From f801af41acb1eebf3813538923f43a7345fe7319 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Mon, 27 May 2024 11:13:52 +0200 Subject: [PATCH 49/62] Add git installation instructions for Windows --- .github/workflows/check.yaml | 5 ----- .github/workflows/simple.yaml | 6 +----- README.md | 27 +++++++++++++++++++++++---- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8b2c3d9a..341ec75d 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -14,11 +14,6 @@ on: branches: - main -# Prerequisites to run workflows: -# Actions -> I understand my workflows... -# Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -# Create a PR from your own branch to main. - # This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created. jobs: job-setup: diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 26e18b35..dac81c70 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -14,11 +14,7 @@ on: branches: - main -# Prerequisites to run workflows: -# Actions -> I understand my workflows... -# Settings -> Actions -> General -> Workflow permissions -> Read and write permissions -# Create a PR from your own branch to main. - +# For reference, this is how the final list of steps will look like: # env: # ENABLED_STEPS: | # checkout_repository diff --git a/README.md b/README.md index d609dc14..ac76c58d 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,34 @@ An example package for the workshop. -## Setting up local environment +## Install `git` and SSH client -You'll need an SSH client and `git`. +### Windows +On Windows you can install `git` together with SSH client from https://git-scm.com/download/win. -For example on Ubuntu, you can install them like this. If you know how to use Docker, you can run these commands in `ubuntu` image. +Below you can find suggested installation customizations, but feel free to customize according to your preferences. + +1. Select Components โ†’ you can unselect `Windows Explorer integration` and `Scalar (Git add-on to manage large-scale repositories)`. +1. Choosing the default editor used by Git โ†’ `Use the Nano editor by default`. +1. Adjusting the name of the initial branch in new repositories โ†’ `Override the default branch name for new repositories` with `main`. +1. Adjusting your PATH environment โ†’ `Use Git from Git Bash only`. +1. Use bundled OpenSSH (default). +1. Use the OpenSSL library (default). +1. Configure the line ending conversions โ†’ `Checkout as-is, commit as-is`. +1. Use MinTTY (default). +1. Fast-forward or merge (default). +1. Git Credential Manager (default). +1. Enable file system caching (default). +1. No experimental options. + +### Ubuntu or Docker container +On Ubuntu, you can install them like this. If you know how to use Docker, you can run these commands in `ubuntu` image. ```bash apt-get update && apt-get install -yq openssh-client git ``` +## Setup write access to GitHub + Create an SSH key pair. ```bash ssh-keygen -P '' -t rsa -b 4096 -C "$(whoami)@$(hostname)" -f ~/.ssh/$(whoami)-github @@ -27,7 +46,7 @@ Copy this and paste to https://github.com/settings/ssh/new. Add any title, and leave key type equal to authentication key. -### Cloning the sample repository +## Cloning the sample repository Clone the `r.package.example` repository. Replace `` with an URL similar to this one: `git@github.com:user-workshop-cicd/r.package.example.git`, but `user-workshop-cicd` should be replaced with your GitHub username. From c59f497a281cc862fb7b9fb9359c6adbca9e5e26 Mon Sep 17 00:00:00 2001 From: walkowif Date: Mon, 27 May 2024 11:27:42 +0200 Subject: [PATCH 50/62] Empty From 4db5cf971130b3d6d8c19869d88da7460739666b Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Mon, 27 May 2024 11:29:54 +0200 Subject: [PATCH 51/62] Update readme --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ac76c58d..17eafe3e 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,11 @@ An example package for the workshop. -## Install `git` and SSH client +## Prepare your local environment for the workshop excercises -### Windows +### Install `git` and SSH client + +#### Windows On Windows you can install `git` together with SSH client from https://git-scm.com/download/win. Below you can find suggested installation customizations, but feel free to customize according to your preferences. @@ -22,13 +24,13 @@ Below you can find suggested installation customizations, but feel free to custo 1. Enable file system caching (default). 1. No experimental options. -### Ubuntu or Docker container +#### Ubuntu or Docker container On Ubuntu, you can install them like this. If you know how to use Docker, you can run these commands in `ubuntu` image. ```bash apt-get update && apt-get install -yq openssh-client git ``` -## Setup write access to GitHub +### Setup write access to GitHub Create an SSH key pair. ```bash @@ -46,11 +48,13 @@ Copy this and paste to https://github.com/settings/ssh/new. Add any title, and leave key type equal to authentication key. -## Cloning the sample repository +### Clone the sample repository Clone the `r.package.example` repository. Replace `` with an URL similar to this one: `git@github.com:user-workshop-cicd/r.package.example.git`, but `user-workshop-cicd` should be replaced with your GitHub username. ```bash +mkdir user-workshop +cd user-workshop git clone cd r.package.example git status @@ -65,6 +69,8 @@ nothing to commit, working tree clean ``` Configure your name and email address - this will be required to push commits. + +You may consider using obfuscated e-mail address like `@example.com`, and `` as `Your Name`. ``` git config --global user.email "you@example.com" git config --global user.name "Your Name" From 59eb530207deb5781221dfe966e21c1a4abf2d31 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 11:43:03 +0200 Subject: [PATCH 52/62] Remove local configuration instructions --- README.md | 74 ------------------------------------------------------- 1 file changed, 74 deletions(-) diff --git a/README.md b/README.md index 17eafe3e..c7886d4a 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,3 @@ # r.package.example An example package for the workshop. - -## Prepare your local environment for the workshop excercises - -### Install `git` and SSH client - -#### Windows -On Windows you can install `git` together with SSH client from https://git-scm.com/download/win. - -Below you can find suggested installation customizations, but feel free to customize according to your preferences. - -1. Select Components โ†’ you can unselect `Windows Explorer integration` and `Scalar (Git add-on to manage large-scale repositories)`. -1. Choosing the default editor used by Git โ†’ `Use the Nano editor by default`. -1. Adjusting the name of the initial branch in new repositories โ†’ `Override the default branch name for new repositories` with `main`. -1. Adjusting your PATH environment โ†’ `Use Git from Git Bash only`. -1. Use bundled OpenSSH (default). -1. Use the OpenSSL library (default). -1. Configure the line ending conversions โ†’ `Checkout as-is, commit as-is`. -1. Use MinTTY (default). -1. Fast-forward or merge (default). -1. Git Credential Manager (default). -1. Enable file system caching (default). -1. No experimental options. - -#### Ubuntu or Docker container -On Ubuntu, you can install them like this. If you know how to use Docker, you can run these commands in `ubuntu` image. -```bash -apt-get update && apt-get install -yq openssh-client git -``` - -### Setup write access to GitHub - -Create an SSH key pair. -```bash -ssh-keygen -P '' -t rsa -b 4096 -C "$(whoami)@$(hostname)" -f ~/.ssh/$(whoami)-github -eval $(ssh-agent) && ssh-add ~/.ssh/$(whoami)-github -cat ~/.ssh/$(whoami)-github.pub -``` - -The result will look like this: -``` -ssh-rsa AAAA... -``` - -Copy this and paste to https://github.com/settings/ssh/new. - -Add any title, and leave key type equal to authentication key. - -### Clone the sample repository - -Clone the `r.package.example` repository. Replace `` with an URL similar to this one: `git@github.com:user-workshop-cicd/r.package.example.git`, but `user-workshop-cicd` should be replaced with your GitHub username. - -```bash -mkdir user-workshop -cd user-workshop -git clone -cd r.package.example -git status -``` - -The output should look like: -``` -On branch main -Your branch is up to date with 'origin/main'. - -nothing to commit, working tree clean -``` - -Configure your name and email address - this will be required to push commits. - -You may consider using obfuscated e-mail address like `@example.com`, and `` as `Your Name`. -``` -git config --global user.email "you@example.com" -git config --global user.name "Your Name" -``` From cf99c3a2aae6e9f286d9a285c01602fe67057cdb Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 11:43:58 +0200 Subject: [PATCH 53/62] Test step output --- .github/workflows/check.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 341ec75d..19a1c2c5 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,6 +13,7 @@ on: push: branches: - main + - setup-workflows # This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created. jobs: @@ -25,7 +26,7 @@ jobs: - name: To check or not to check? id: check run: | - echo "run_r_cmd_check=false" >> $GITHUB_OUTPUT + echo "run_r_cmd_check=true" >> $GITHUB_OUTPUT r-cmd: name: R CMD Check ๐Ÿงฌ From cf53ed2323eaa0ff80c06372c41b2dbcf5923b1c Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 12:07:26 +0200 Subject: [PATCH 54/62] Update --- .github/workflows/check.yaml | 2 +- .github/workflows/simple.yaml | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 19a1c2c5..0fb6ef7e 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -26,7 +26,7 @@ jobs: - name: To check or not to check? id: check run: | - echo "run_r_cmd_check=true" >> $GITHUB_OUTPUT + echo "run_r_cmd_check=false" >> $GITHUB_OUTPUT r-cmd: name: R CMD Check ๐Ÿงฌ diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index dac81c70..329b37db 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -13,6 +13,7 @@ on: push: branches: - main + - setup-workflows # For reference, this is how the final list of steps will look like: # env: @@ -25,8 +26,11 @@ on: # run_r_cmd_check # upload_artifact -# When asked to, please add the steps from the list above: env: + _R_CHECK_TESTS_NLINES_: 0 + _R_CHECK_VIGNETTES_NLINES_: 0 + EXTRA_CHECK_FLAGS: "--no-manual --no-vignettes" + # When asked to, please add the steps from the list above: ENABLED_STEPS: | checkout_... setup_... @@ -82,14 +86,14 @@ jobs: # Get package name and version from DESCRIPTION so that we'll know # what's the name of the tar.gz file with the built package. - # PKGBUILD environment variable is saved as an environment variable so this - # information can be accessed by subsequent steps. + # pkgbuild is set as an output which can be accessed by subsequent steps. - name: Get package name ๐Ÿ“ฆ if: contains(env.ENABLED_STEPS, 'get_package_name') + id: package-name run: | PKGBUILD="$(Rscript -e 'cat(sprintf("%s_%s.tar.gz",(dcf <- read.dcf("DESCRIPTION"))[,"Package"], dcf[,"Version"]))')" echo "PKGBUILD = $PKGBUILD" - echo "PKGBUILD=$PKGBUILD" >> $GITHUB_ENV + echo "pkgbuild=$PKGBUILD" >> $GITHUB_OUTPUT shell: bash working-directory: ${{ github.event.repository.name }} @@ -107,11 +111,11 @@ jobs: - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | - R CMD check --no-manual --no-vignettes ${{ env.PKGBUILD }} + echo "_R_CHECK_TESTS_NLINES_ = $_R_CHECK_TESTS_NLINES_" + echo "_R_CHECK_VIGNETTES_NLINES_ = $_R_CHECK_VIGNETTES_NLINES_" + echo "Let's run R CMD check..." + R CMD check ${EXTRA_CHECK_FLAGS} ${{ steps.package-name.outputs.pkgbuild }} shell: bash - env: - _R_CHECK_TESTS_NLINES_: 0 - _R_CHECK_VIGNETTES_NLINES_: 0 - name: Get tar.gz file name if: contains(env.ENABLED_STEPS, 'upload_artifact') From 42dfd58f58224c76f468200b008916cc3482b55a Mon Sep 17 00:00:00 2001 From: walkowif <59475134+walkowif@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:11:04 +0200 Subject: [PATCH 55/62] Update simple.yaml --- .github/workflows/simple.yaml | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 329b37db..5e9af541 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -15,30 +15,19 @@ on: - main - setup-workflows -# For reference, this is how the final list of steps will look like: -# env: -# ENABLED_STEPS: | -# checkout_repository -# setup_r -# setup_dependencies -# get_package_name -# build_r_package -# run_r_cmd_check -# upload_artifact - env: _R_CHECK_TESTS_NLINES_: 0 _R_CHECK_VIGNETTES_NLINES_: 0 EXTRA_CHECK_FLAGS: "--no-manual --no-vignettes" # When asked to, please add the steps from the list above: ENABLED_STEPS: | - checkout_... - setup_... - setup_... - get_package_... - build_r_... - run_r_... - upload_... + checkout_repository + setup_r + setup_dependencies + get_package_name + build_r_package + run_r_cmd_check + upload_artifact jobs: # First job. From 94032ce1a1928db864e9a4de9e5cb20eaaa260e1 Mon Sep 17 00:00:00 2001 From: walkowif <59475134+walkowif@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:14:26 +0200 Subject: [PATCH 56/62] Update .github/workflows/simple.yaml Co-authored-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> --- .github/workflows/simple.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 5e9af541..124cd00c 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -16,9 +16,12 @@ on: - setup-workflows env: + # additional flags for `R CMD CHECK` + EXTRA_CHECK_FLAGS: "--no-manual --no-vignettes" + # additional environmental vars for `R CMD CHECK` + # see manual here: https://rstudio.github.io/r-manuals/r-ints/Tools.html _R_CHECK_TESTS_NLINES_: 0 _R_CHECK_VIGNETTES_NLINES_: 0 - EXTRA_CHECK_FLAGS: "--no-manual --no-vignettes" # When asked to, please add the steps from the list above: ENABLED_STEPS: | checkout_repository From 6ef0ce3726fc0bdb9268f8ff62305aee605e454f Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 12:18:41 +0200 Subject: [PATCH 57/62] Comment steps --- .github/workflows/simple.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 124cd00c..445c9f15 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -25,12 +25,12 @@ env: # When asked to, please add the steps from the list above: ENABLED_STEPS: | checkout_repository - setup_r - setup_dependencies - get_package_name - build_r_package - run_r_cmd_check - upload_artifact +# setup_r +# setup_dependencies +# get_package_name +# build_r_package +# run_r_cmd_check +# upload_artifact jobs: # First job. From 5518e080b9bb0c994a32d7795a0a5d277a7032f0 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 12:43:54 +0200 Subject: [PATCH 58/62] Remove any::rcmdcheck --- .github/workflows/simple.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 445c9f15..71519712 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -73,7 +73,6 @@ jobs: uses: r-lib/actions/setup-r-dependencies@v2 if: contains(env.ENABLED_STEPS, 'setup_dependencies') with: - extra-packages: any::rcmdcheck working-directory: ${{ github.event.repository.name }} # Get package name and version from DESCRIPTION so that we'll know From 3381cc1dd86486a5c0aceb9d0393e0b392907451 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 12:44:40 +0200 Subject: [PATCH 59/62] Uncomment steps --- .github/workflows/check.yaml | 1 - .github/workflows/simple.yaml | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 0fb6ef7e..341ec75d 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -13,7 +13,6 @@ on: push: branches: - main - - setup-workflows # This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created. jobs: diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 71519712..2ab27ad6 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -13,7 +13,6 @@ on: push: branches: - main - - setup-workflows env: # additional flags for `R CMD CHECK` @@ -25,12 +24,12 @@ env: # When asked to, please add the steps from the list above: ENABLED_STEPS: | checkout_repository -# setup_r -# setup_dependencies -# get_package_name -# build_r_package -# run_r_cmd_check -# upload_artifact + setup_r + setup_dependencies + get_package_name + build_r_package + run_r_cmd_check + upload_artifact jobs: # First job. From 8b71f3f3b000b8918175f561ee05f930bf68ebfb Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 12:45:42 +0200 Subject: [PATCH 60/62] Fix yaml --- .github/workflows/simple.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 2ab27ad6..02ec4e41 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -21,15 +21,14 @@ env: # see manual here: https://rstudio.github.io/r-manuals/r-ints/Tools.html _R_CHECK_TESTS_NLINES_: 0 _R_CHECK_VIGNETTES_NLINES_: 0 - # When asked to, please add the steps from the list above: ENABLED_STEPS: | checkout_repository - setup_r - setup_dependencies - get_package_name - build_r_package - run_r_cmd_check - upload_artifact + setup_r + setup_dependencies + get_package_name + build_r_package + run_r_cmd_check + upload_artifact jobs: # First job. From 6c536d158c2132f5ec9323e6d40dbb9812f6bae5 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Tue, 11 Jun 2024 13:48:15 +0200 Subject: [PATCH 61/62] Print all R variables --- .github/workflows/simple.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index 02ec4e41..abc1bef2 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -100,8 +100,7 @@ jobs: - name: Run R CMD check ๐Ÿ if: contains(env.ENABLED_STEPS, 'run_r_cmd_check') run: | - echo "_R_CHECK_TESTS_NLINES_ = $_R_CHECK_TESTS_NLINES_" - echo "_R_CHECK_VIGNETTES_NLINES_ = $_R_CHECK_VIGNETTES_NLINES_" + env | grep -E '^_R' echo "Let's run R CMD check..." R CMD check ${EXTRA_CHECK_FLAGS} ${{ steps.package-name.outputs.pkgbuild }} shell: bash From 0cec831bae98ef47a931c0037ee2cf80b04f7274 Mon Sep 17 00:00:00 2001 From: walkowif <59475134+walkowif@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:52:04 +0200 Subject: [PATCH 62/62] Update .github/workflows/simple.yaml --- .github/workflows/simple.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index abc1bef2..dcdd1d11 100644 --- a/.github/workflows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -23,12 +23,12 @@ env: _R_CHECK_VIGNETTES_NLINES_: 0 ENABLED_STEPS: | checkout_repository - setup_r - setup_dependencies - get_package_name - build_r_package - run_r_cmd_check - upload_artifact +# setup_r +# setup_dependencies +# get_package_name +# build_r_package +# run_r_cmd_check +# upload_artifact jobs: # First job.