-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (86 loc) · 2.99 KB
/
revdep-check-test.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Reverse Dependency Check
on:
workflow_dispatch:
jobs:
revdep_check:
runs-on: ubuntu-latest
name: Reverse check ${{ inputs.which }} dependents
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 \
libfreetype6-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libpng-dev \
libjpeg-dev \
libtiff5-dev \
gfortran \
libblas-dev \
liblapack-dev
- name: Install R dependencies
run: |
Rscript -e "install.packages(c('remotes', 'revdepcheck', 'testthat', 'rcmdcheck'))"
Rscript -e "remotes::install_deps(dependencies = TRUE)"
- name: Setup Reverse Dependency Check
run: |
Rscript -e "
rev_deps <- tools::package_dependencies(
packages = 'ptetools',
db = available.packages(),
reverse = TRUE
)
rev_deps <- rev_deps[['ptetools']]
cat('Testing the following reverse dependencies:', rev_deps, '\n')
for (pkg in rev_deps) {
cat('Installing package:', pkg, '\n')
install.packages(pkg, dependencies = TRUE)
}
"
- name: Reverse Dependency Check
run: |
Rscript -e "
rev_deps <- tools::package_dependencies(
packages = 'BMisc',
db = available.packages(),
reverse = TRUE
)
rev_deps <- rev_deps[['BMisc']]
dir.create('revdep_tarballs', showWarnings = FALSE)
for (pkg in rev_deps) {
cat('Checking package:', pkg, '\n')
# Download the source tarball
tarball <- tryCatch({
tarball_info <- download.packages(pkg, destdir = 'revdep_tarballs', type = 'source')
# Extract the correct tarball file path
tarball_path <- tarball_info[, 2] # The second column contains the file path
tarball_path # Return the correct path
}, error = function(e) {
cat('Error downloading source tarball for package:', pkg, '\n', conditionMessage(e), '\n')
next
})
pkg_path <- find.package(pkg, quiet = TRUE)
tryCatch({
rcmdcheck::rcmdcheck(tarball, error_on = 'never', args = '--no-manual')
}, error = function(e) {
cat('Error checking package:', pkg, '\n', conditionMessage(e), '\n')
})
}
"
- name: Upload Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Reverse-Dependency-Check-Results
path: revdep/