-
Notifications
You must be signed in to change notification settings - Fork 13
136 lines (114 loc) · 4.04 KB
/
Copy pathR-CMD-check.yaml
File metadata and controls
136 lines (114 loc) · 4.04 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: R-CMD-check.yaml
permissions: read-all
jobs:
changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- 'src/**'
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
_R_CHECK_RD_CONTENTS_VALUE_: 1
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
clang-ASAN:
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
name: "Minimal clang-ASAN"
runs-on: ubuntu-latest
container: rocker/r-devel-ubsan-clang
env:
_R_CHECK_TESTS_NLINES_: 0
ASAN_OPTIONS: 'detect_leaks=0:halt_on_error=1'
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
CC: "clang -fsanitize=address,undefined -fno-omit-frame-pointer"
CXX: "clang++ -fsanitize=address,undefined -fno-omit-frame-pointer"
CFLAGS: "-g -O3"
CXXFLAGS: "-g -O3"
steps:
- uses: actions/checkout@v4
- name: Set up ASAN
run: echo "LD_PRELOAD=$(clang -print-file-name=libclang_rt.asan-x86_64.so)" >> $GITHUB_ENV
- name: Install dependencies
run: |
apt-get update && apt-get install -y libuv1-dev
mkdir -p ~/.R
echo "CC=$CC" >> ~/.R/Makevars
echo "CXX=$CXX" >> ~/.R/Makevars
echo "CFLAGS=$CFLAGS" >> ~/.R/Makevars
echo "CXXFLAGS=$CXXFLAGS" >> ~/.R/Makevars
Rscript -e 'install.packages("remotes", repos="https://cloud.r-project.org"); remotes::install_deps(dependencies = TRUE, type = "source")'
- name: Build and Check
run: |
R CMD build .
R CMD check bit64_*.tar.gz --as-cran --no-manual --no-vignettes
test-ancient:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: '3.6.0'
- name: Install bit64 and dependencies
run: |
Rscript -e 'options(repos = "https://cloud.r-project.org"); install.packages("bit")'
R CMD INSTALL .
cp .devcontainer/r-360/.Rprofile .
- name: Run Tests
shell: bash
run: |
EXIT_CODE=0
for FILE in tests/testthat/test-*.R; do
echo "----------------------------------------------------------------"
echo "Running $FILE"
sed -E "s/(patrick|withr):://g" "$FILE" > "${FILE}_SHIMMED.R"
Rscript -e "library(methods); suppressWarnings(suppressMessages(library(bit64))); source('tests/testthat/helper.R'); source('${FILE}_SHIMMED.R')"
rm "${FILE}_SHIMMED.R"
# Capture failure
if [ $? -ne 0 ]; then
EXIT_CODE=1
fi
done
exit $EXIT_CODE