-
-
Notifications
You must be signed in to change notification settings - Fork 11
67 lines (58 loc) · 2.1 KB
/
rev-dep-check.yaml
File metadata and controls
67 lines (58 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Reverse Dep Check
on:
pull_request:
branches: [ main ]
jobs:
gtsummary:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
- name: Install and Cache Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
# List the packages your script needs here
extra-packages: |
any::checked
any::rlang
any::cli
# This key ensures that if you change the list above,
# it creates a new cache rather than using an old one.
cache-version: 1
- name: Check Reverse Dependencies
shell: Rscript {0}
run: |
df <-
checked::rev_dep_check_tasks_df(
path = ".",
repos = "https://packagemanager.posit.co/cran/latest",
versions = c("dev", "release")
)
df <- df[startsWith(df$alias, "gtsummary"), ]
design <-
checked::check_design$new(
df = df,
repos = "https://packagemanager.posit.co/cran/latest",
output = tempdir(),
restore = FALSE
)
checked::run(design)
checked::results(design)
# Logic to check for errors and abort if found
issues <- checked::results(design)$revdep_check_task_spec$gtsummary$errors$issues
if (!rlang::is_empty(issues)) {
cli::cli_abort(
c("This PR newly breaks {.pkg gtsummary}",
"!" = "The PR must be updated as to not break {.pkg gtsummary}.",
"i" = "In rare cases where the break is acceptable, the change {.emph MUST} first be approved by Daniel Sjoberg (danieldsjoberg@gmail.com) {.emph before} this PR could potentially be merged."
)
)
}