-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3baca52
commit 5a9dd01
Showing
9 changed files
with
257 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: R Package Checks and Coverage | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: windows-latest, r: 'release'} | ||
- {os: windows-latest, r: 'devel'} | ||
- {os: macOS-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'devel'} | ||
|
||
name: ${{ matrix.config.os }} (R ${{ matrix.config.r }}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
- name: Install dependencies | ||
run: | | ||
Rscript -e "install.packages('remotes')" | ||
Rscript -e "remotes::install_deps(dependencies = TRUE)" | ||
- name: Install system dependencies (Ubuntu only) | ||
if: runner.os == 'Linux' | ||
run: 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 | ||
- name: Setup Check | ||
run: | | ||
Rscript -e "install.packages('rcmdcheck')" | ||
mkdir -p "check-${{ matrix.config.os }}" | ||
- name: Check | ||
run: | | ||
Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error', check_dir = 'check-${{ matrix.config.os }}')" | ||
- name: Setup Test | ||
run: | | ||
mkdir -p "test-results-${{ matrix.config.os }}" | ||
Rscript -e "install.packages('testthat')" | ||
Rscript -e "install.packages('devtools')" | ||
Rscript -e "devtools::install('.', dependencies = TRUE)" | ||
- name: Test | ||
run: | | ||
Rscript -e "testthat::test_dir('tests', reporter = testthat::SummaryReporter)" | ||
- name: Code Coverage | ||
if: matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'release' | ||
run: | | ||
Rscript -e "install.packages('covr')" | ||
Rscript -e "covr::codecov()" | ||
- name: Upload check results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: R-CMD-check-results-${{ matrix.config.os }}-${{ matrix.config.r }} | ||
path: check-* | ||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: R-test-results-${{ matrix.config.os }}-${{ matrix.config.r }} | ||
path: test-results-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
library(testthat) | ||
library(ptetools) | ||
|
||
test_check("ptetool") | ||
test_check("ptetools") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.