From c25a5efff165afdf95b186e84e389e3ee067e9e4 Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Mon, 11 Mar 2024 12:01:00 +0100
Subject: [PATCH 1/8] [skip ci] Workflow propagation

---
 .github/workflows/check.yaml   |  2 ++
 .github/workflows/cla.yaml     | 18 ++++++++++++++++++
 .github/workflows/release.yaml | 13 ++-----------
 3 files changed, 22 insertions(+), 11 deletions(-)
 create mode 100644 .github/workflows/cla.yaml

diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml
index 7951841a8..6a4fa3b4a 100644
--- a/.github/workflows/check.yaml
+++ b/.github/workflows/check.yaml
@@ -86,6 +86,8 @@ jobs:
     uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main
     with:
       auto-update: true
+    secrets:
+      REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
   grammar:
     if: github.event_name != 'push'
     name: Grammar Check 🔤
diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml
new file mode 100644
index 000000000..b674b0b45
--- /dev/null
+++ b/.github/workflows/cla.yaml
@@ -0,0 +1,18 @@
+name: CLA 🔏
+
+on:
+  issue_comment:
+    types:
+      - created
+  # For PRs that originate from forks
+  pull_request_target:
+    types:
+      - opened
+      - closed
+      - synchronize
+
+jobs:
+  CLA:
+    name: CLA 📝
+    uses: insightsengineering/.github/.github/workflows/cla.yaml@main
+    secrets: inherit
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 0fa4a06c8..226473ce9 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -8,15 +8,6 @@ on:
   workflow_dispatch:
 
 jobs:
-  build:
-    name: Build package 🎁
-    needs: release
-    uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
-    secrets:
-      REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
-    with:
-      skip-r-cmd-check: true
-      skip-r-cmd-install: true
   docs:
     name: Pkgdown Docs 📚
     needs: release
@@ -36,8 +27,8 @@ jobs:
     uses: insightsengineering/r.pkg.template/.github/workflows/release.yaml@main
     secrets:
       REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
-  r-cmd:
-    name: R CMD Check 🧬
+  build:
+    name: Build package and reports 🎁
     needs: [release, docs]
     uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
     secrets:

From b7453c28b22a5e193bf381a743c74b6c8d4e84fa Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Fri, 26 Apr 2024 11:41:41 +0200
Subject: [PATCH 2/8] Add revdepcheck configuration

---
 .Rbuildignore                    |  2 ++
 .github/workflows/on-demand.yaml | 12 ++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 .github/workflows/on-demand.yaml

diff --git a/.Rbuildignore b/.Rbuildignore
index c9f2bcf2b..7655893af 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -41,3 +41,5 @@ SECURITY.md
 ^test_full_example$
 coverage.*
 ^pkgdown$
+^revdeprefs\.yaml$
+^revdep$
diff --git a/.github/workflows/on-demand.yaml b/.github/workflows/on-demand.yaml
new file mode 100644
index 000000000..02843bb32
--- /dev/null
+++ b/.github/workflows/on-demand.yaml
@@ -0,0 +1,12 @@
+---
+name: On-demand 🧑‍🔬
+
+on:
+  schedule:
+    - cron: '45 3 * * 0'
+  workflow_dispatch:
+
+jobs:
+  revdepcheck:
+    name: revdepcheck ↩️
+    uses: insightsengineering/r.pkg.template/.github/workflows/revdepcheck.yaml@main

From ebeca788317b306521b4a9deb284c78c9bf62bb9 Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Fri, 26 Apr 2024 14:16:40 +0200
Subject: [PATCH 3/8] Add .covrignore to .Rbuildignore

---
 .Rbuildignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.Rbuildignore b/.Rbuildignore
index 7655893af..5d20833d3 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -43,3 +43,4 @@ coverage.*
 ^pkgdown$
 ^revdeprefs\.yaml$
 ^revdep$
+^\.covrignore$

From 643662ddfff6f896bd0b864882347db3d7817d27 Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Fri, 26 Apr 2024 14:32:11 +0200
Subject: [PATCH 4/8] Add .covrignore to .pre-commit-config.yaml

---
 .pre-commit-config.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f1b190095..9b3acfacc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -38,6 +38,7 @@ repos:
           .*\.svg|
           .*\.xml|
           (.*/|)\_pkgdown.y[a]?ml|
+          (.*/|)\.covrignore|
           (.*/|)\.gitignore|
           (.*/|)\.gitlab-ci\.y[a]?ml|
           (.*/|)\.lintr|

From 09a394f16d5dd538d0421bb7efa677bdb15c559c Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Fri, 26 Apr 2024 15:00:44 +0200
Subject: [PATCH 5/8] Add new testthat snapshots to .gitignore

---
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitignore b/.gitignore
index 7096c5c03..cf72c037b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,5 @@ vignettes/*.R
 vignettes/*.html
 vignettes/*.md
 tests/testthat/Rplots.pdf
+tests/testthat/_snaps/**/*.new.md
+tests/testthat/_snaps/**/*.new.svg

From 676138659986ad72f67fedebb01de85644088f6f Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Fri, 26 Apr 2024 15:26:07 +0200
Subject: [PATCH 6/8] [skip ci] Add revdep directory

---
 revdep/.gitignore | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 revdep/.gitignore

diff --git a/revdep/.gitignore b/revdep/.gitignore
new file mode 100644
index 000000000..111ab324f
--- /dev/null
+++ b/revdep/.gitignore
@@ -0,0 +1,7 @@
+checks
+library
+checks.noindex
+library.noindex
+cloud.noindex
+data.sqlite
+*.html

From e77a45e0777ccb8159901ebe235aeaaf85a9dc3a Mon Sep 17 00:00:00 2001
From: Franciszek Walkowiak <franciszek.walkowiak@roche.com>
Date: Fri, 26 Apr 2024 15:33:40 +0200
Subject: [PATCH 7/8] [skip ci] Fix typo

---
 .Rbuildignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.Rbuildignore b/.Rbuildignore
index 5d20833d3..5164b2a4d 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -41,6 +41,6 @@ SECURITY.md
 ^test_full_example$
 coverage.*
 ^pkgdown$
-^revdeprefs\.yaml$
+^.revdeprefs\.yaml$
 ^revdep$
 ^\.covrignore$

From 808d663ab811105941bcfbd7ddbe3f3f58787426 Mon Sep 17 00:00:00 2001
From: cicdguy <26552821+cicdguy@users.noreply.github.com>
Date: Mon, 29 Apr 2024 08:28:51 -0500
Subject: [PATCH 8/8] Add snapshot testing job

Signed-off-by: cicdguy <26552821+cicdguy@users.noreply.github.com>
---
 .github/workflows/check.yaml | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml
index 6a4fa3b4a..1b251b8d6 100644
--- a/.github/workflows/check.yaml
+++ b/.github/workflows/check.yaml
@@ -40,6 +40,27 @@ jobs:
         checking top-level files .* NOTE
       unit-test-report-brand: >-
         https://raw.githubusercontent.com/insightsengineering/hex-stickers/main/thumbs/teal.png
+  r-cmd-non-cran:
+    name: R CMD Check (non-CRAN) 🧬
+    uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
+    secrets:
+      REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
+    with:
+      enforce-note-blocklist: true
+      publish-unit-test-report-gh-pages: false
+      junit-xml-comparison: false
+      concurrency-group: non-cran
+      disable-unit-test-reports: true
+      skip-r-cmd-install: true
+      note-blocklist: |
+        checking dependencies in R code .* NOTE
+        checking R code for possible problems .* NOTE
+        checking examples .* NOTE
+        checking Rd line widths .* NOTE
+        checking S3 generic/method consistency .* NOTE
+        checking Rd .usage sections .* NOTE
+        checking for unstated dependencies in vignettes .* NOTE
+        checking top-level files .* NOTE
   coverage:
     name: Coverage 📔
     uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
