Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/sanitizer-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: Sanitizer-check

jobs:
Sanitizer-check:
runs-on: ubuntu-latest
container: wch1/r-debug

steps:
- uses: actions/checkout@v4

- name: Run sanitizer checks
run: |
Rscript -e 'install.packages("devtools", repos="http://cran.us.r-project.org")'
Rscript -e 'devtools::install_deps(dependencies = TRUE)'
Rscript scripts/run-sanitizer-checks.R
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ setup: # install tools necessary for building the package
document: # generate R docs from source code
Rscript -e "devtools::document()"

.PHONY: sanitizer-check
sanitizer-check: # run sanitizer checks using a docker image
docker run -it --rm -v $(pwd):/mypkg -w /mypkg wch/r-debug R -f scripts/run-sanitizer-checks.R

.PHONY: help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
Expand Down
5 changes: 5 additions & 0 deletions scripts/run-sanitizer-checks.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Check for UBSan and ASan issues
# To run locally:
# docker run -it --rm -v $(pwd):/mypkg -w /mypkg wch/r-debug
# R -f scripts/run-sanitizer-checks.R
devtools::check(args = c("--as-cran"), env = c("ASAN_OPTIONS=detect_leaks=0", "_R_CHECK_AS_CRAN_" = "true"))
Loading