-
Notifications
You must be signed in to change notification settings - Fork 3
177 lines (159 loc) · 5.86 KB
/
ci-tests.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
name: ci-tests
on:
push:
branches: [ "feature/google_bigquery_connector" ]
pull_request:
branches: [ "feature/google_bigquery_connector" ]
jobs:
build:
runs-on: ${{ matrix.config.os-name }}-${{ matrix.config.os-version }}
name: >-
${{ matrix.config.os-name }}-${{ matrix.config.os-version }}
R ${{ matrix.config.r-version}} - Java ${{ matrix.config.java}}
Spark ${{ matrix.config.spark }}
strategy:
fail-fast: false
matrix:
config:
- os-name: ubuntu
os-version: latest
java: 17
spark: "3.5"
r-version: release
# - os-name: ubuntu
# os-version: latest
# java: 8
# spark: "2.4"
# r-version: devel
# - os-name: ubuntu
# os-version: "22.04"
# java: 11
# spark: "3.0"
# r-version: oldrel
# - os-name: macos
# os-version: latest
# java: 8
# spark: "3.2"
# r-version: release
# - os-name: macos
# os-version: latest
# java: 17
# spark: "3.4"
# r-version: devel
# - os-name: windows
# os-version: latest
# java: 8
# spark: "3.1"
# r-version: oldrel
# - os-name: windows
# os-version: "2022"
# java: 17
# spark: "3.3"
# r-version: release
env:
SPARK_VERSION: ${{ matrix.config.spark }}
BIGQUERY_PROJECT_ID: mirai-sbb
BIGQUERY_MATERIALIZATION_DATASET: test
BIGQUERY_APPLICATION_CREDENTIALS: ${{ github.workspace }}/adc.json
R_DEFAULT_INTERNET_TIMEOUT: 1800
# Override where sparklyr is getting Spark version information from
R_SPARKINSTALL_INSTALL_INFO_PATH: ${{ github.workspace }}/spark_versions.json
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4.4.0
with:
distribution: 'zulu'
java-version: ${{ matrix.config.java }}
java-package: jdk
architecture: x64
- name: Print effective Java version
run: java -version
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r-version }}
use-public-rspm: true
- name: Print effective R version
run: version
shell: Rscript {0}
- name: R CMD javareconf
if: runner.os != 'Windows'
run: |
java -version
echo java_home:$JAVA_HOME
echo library paths: $LD_LIBRARY_PATH
sudo R CMD javareconf JAVA_HOME=$JAVA_HOME
- name: Install and cache dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: ${{ matrix.config.java }}
extra-packages: |
any::rcmdcheck
- name: Install Microsoft Visual C++ 2010 SP1 Redistributable Package via Chocolatey
if: runner.os == 'Windows'
run: |
# Install the package using Chocolatey
choco install vcredist2010 -y --allow-empty-checksums
- name: Install Spark
run: |
info <- sparklyr::spark_install(version="${{ matrix.config.spark }}")
if (.Platform$OS.type == "windows") {
hadoop_path <- file.path(info$sparkVersionDir, "tmp", "hadoop")
hadoop_bin_path <- file.path(hadoop_path, "bin")
dir.create(hadoop_bin_path, recursive = TRUE)
cat(
c(
paste0("HADOOP_VERSION=", info$hadoopVersion),
paste0("HADOOP_HOME=", hadoop_path),
paste0("PATH=", Sys.getenv("PATH"), ":", hadoop_bin_path)
),
file = Sys.getenv("GITHUB_ENV"),
sep = "\n",
append = TRUE
)
}
shell: Rscript {0}
- name: Install Winutils
if: runner.os == 'Windows'
run: |
git clone https://github.com/cdarlint/winutils.git C:/tmp/winutils
LATEST_HADOOP_DIR=$(ls -d C:/tmp/winutils/hadoop-${HADOOP_VERSION}* | sort -V | tail -n 1)
echo "Latest Hadoop Directory: ${LATEST_HADOOP_DIR}"
cp -R ${LATEST_HADOOP_DIR}/bin ${HADOOP_HOME}
shell: bash
- name: Set Google application default credentials
env:
ADC: ${{ secrets.GCLOUD_APPLICATION_CREDENTIALS }}
shell: bash
run: |
echo "$ADC" > $BIGQUERY_APPLICATION_CREDENTIALS
- name: Run R CMD check
uses: r-lib/actions/check-r-package@v2
with:
error-on: '"error"'
check-dir: '"check"'
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ matrix.config.os-name }}${{matrix.config.os-version}}-Java${{ matrix.config.java }}-R${{ matrix.config.r-version }}-Spark${{ matrix.config.spark }}-results
path: |
check/sparkbq.Rcheck/
!check/sparkbq.Rcheck/00_pkg_src/
!adc.json
- name: Upload successfully built package
if: success()
uses: actions/upload-artifact@main
with:
name: ${{ matrix.config.os-name }}${{matrix.config.os-version}}-Java${{ matrix.config.java }}-R${{ matrix.config.r-version }}-Spark${{ matrix.config.spark }}-results
path: |
check/sparkbq_*.tar.gz
!adc.json