forked from apache/arrow-adbc
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (138 loc) · 5.12 KB
/
r-extended.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: R (extended)
# Runs weekly. This catches changes that happen because of
# dependency updates and catches some of the more infrequent/obscure
# changes that affect the R package.
on:
# Also can trigger manually (e.g., if release is upcoming, etc.)
workflow_dispatch:
schedule:
- cron: '5 0 * * 0'
pull_request:
branches:
- main
paths:
- ".github/workflows/r-extended.yml"
permissions:
contents: read
jobs:
# Runs R CMD check on the same platforms/R versions CRAN does
cran:
strategy:
matrix:
rversion: [oldrel, release, devel]
os: [macOS, windows, ubuntu]
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake, adbcbigquery]
fail-fast: false
uses: ./.github/workflows/r-check.yml
with:
os: ${{ matrix.os }}
pkg: ${{ matrix.pkg }}
rversion: ${{ matrix.rversion }}
secrets:
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
# Check older versions of R on Linux. This catches accidental use of newer R functions.
rversions:
strategy:
matrix:
rversion: ["3.6", "4.0", "4.1"]
os: [ubuntu]
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake, adbcbigquery]
fail-fast: false
uses: ./.github/workflows/r-check.yml
with:
os: ${{ matrix.os }}
pkg: ${{ matrix.pkg }}
rversion: ${{ matrix.rversion }}
secrets:
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
# Checks on older verions of R on Windows. The Windows build system changed
# several times so we need to check packages on every version. Go-based
# drivers aren't supported before 4.2, so we don't check them here.
# We don't need to check R 4.1 because the build system for R 4.0 and R 4.1
# are the same.
winrversions:
strategy:
matrix:
rversion: ["3.6", "4.0"]
os: [windows]
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
fail-fast: false
uses: ./.github/workflows/r-check.yml
with:
os: ${{ matrix.os }}
pkg: ${{ matrix.pkg }}
rversion: ${{ matrix.rversion }}
secrets:
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
# Runs tests with valgrind. Go does not support valgrind, so we don't run
# those tests here.
valgrind:
name: "valgrind (${{ matrix.pkg }})"
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
rversion: [release]
os: [ubuntu]
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
rversion: ${{ matrix.rversion }}
use-public-rspm: true
- name: Install valgrind
run: |
sudo apt-get install -y valgrind
# Usually, pak::pkg_install() will run bootstrap.R if it is included and is declared;
# however, this doesn't work for local:: for some reason (which is what
# setup-r-dependencies uses under the hood)
- name: Bootstrap R Package
run: |
pushd r/adbcdrivermanager
R -e 'if (!requireNamespace("nanoarrow", quietly = TRUE)) install.packages("nanoarrow", repos = "https://cloud.r-project.org/")'
R CMD INSTALL . --preclean
popd
pushd "r/${{ matrix.pkg }}"
Rscript bootstrap.R
popd
shell: bash
- uses: r-lib/actions/setup-r-dependencies@f4937e0dc26f9b99c969cd3e4ca943b576e7f991
with:
working-directory: r/${{ matrix.pkg }}
- name: Start postgres test database
if: matrix.pkg == 'adbcpostgresql'
run: |
cd r/adbcpostgresql
docker compose up --detach postgres-test
ADBC_POSTGRESQL_TEST_URI="postgresql://localhost:5432/postgres?user=postgres&password=password"
echo "ADBC_POSTGRESQL_TEST_URI=${ADBC_POSTGRESQL_TEST_URI}" >> $GITHUB_ENV
- name: Run devtools::test() with valgrind
run: |
cd r/${{ matrix.pkg }}
R -d "valgrind --tool=memcheck --leak-check=full --suppressions=../valgrind.supp --error-exitcode=1" -e "testthat::test_local()" > valgrind.out 2>&1
- name: Show output
if: always()
run: |
cd r/${{ matrix.pkg }}
cat valgrind.out
- name: Shutdown docker compose services
if: always()
run: |
docker compose down