Skip to content

Commit

Permalink
add jobs mimicking CRAN gcc-ASAN and clang-ASAN
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Oct 14, 2021
1 parent b1b6db4 commit b0043a6
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,29 @@ jobs:
$env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test_windows.ps1"
test-r-sanitizers:
name: r-package (ubuntu-latest, R-devel, GCC ASAN/UBSAN)
timeout-minutes: 60
name: r-package (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
runs-on: ubuntu-latest
container: rhub/rocker-gcc-san
container: wch1/r-debug
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
################
# CMake builds #
################
- r_customization: san
compiler: gcc
- r_customization: csan
compiler: clang
env:
# env variables from CRAN's configuration: https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt
ASAN_OPTIONS: "detect_leaks=0:detect_odr_violation=0"
UBSAN_OPTIONS: "print_stacktrace=1"
RJAVA_JVM_STACK_WORKAROUND: 0
RGL_USE_NULL: true
R_DONT_USE_TK: true
steps:
- name: Install Git before checkout
shell: bash
run: |
apt-get update --allow-releaseinfo-change
apt-get install --no-install-recommends -y git
- name: Checkout repository
uses: actions/[email protected]
with:
Expand All @@ -191,16 +204,18 @@ jobs:
- name: Install packages
shell: bash
run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'Matrix', 'testthat'), repos = 'https://cran.r-project.org', Ncpus = parallel::detectCores())"
RDscript${{ matrix.r_customization }} -e "install.packages(c('R6', 'data.table', 'jsonlite', 'Matrix', 'testthat'), repos = 'https://cran.r-project.org', Ncpus = parallel::detectCores())"
sh build-cran-package.sh
Rdevel CMD INSTALL lightgbm_*.tar.gz || exit -1
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit -1
- name: Run tests with sanitizers
shell: bash
run: |
cd R-package/tests
Rscriptdevel testthat.R 2>&1 > ubsan-tests.log
cat ubsan-tests.log
exit $(cat ubsan-tests.log | grep --count "runtime error")
exit_code=$(
RDscript${{ matrix.r_customization }} testthat.R >> tests.log 2>&1
)
cat ./tests.log
exit ${exit_code}
test-r-debian-clang:
name: r-package (debian, R-devel, clang)
timeout-minutes: 60
Expand Down

0 comments on commit b0043a6

Please sign in to comment.