forked from apache/sedona
-
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (143 loc) · 4.8 KB
/
r.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
name: R build
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-18.04
strategy:
fail-fast: true
matrix:
spark: [2.4.8, 3.0.3, 3.1.2, 3.2.1]
scala: [2.11.8, 2.12.15]
r: [oldrel, release]
exclude:
- spark: 3.2.1
scala: 2.11.8
r: oldrel
- spark: 3.2.1
scala: 2.11.8
r: release
- spark: 3.1.2
scala: 2.11.8
r: oldrel
- spark: 3.1.2
scala: 2.11.8
r: release
- spark: 3.0.3
scala: 2.11.8
r: oldrel
- spark: 3.0.3
scala: 2.11.8
r: release
- spark: 2.4.8
scala: 2.12.15
r: oldrel
- spark: 2.4.8
scala: 2.12.15
r: release
env:
SPARK_VERSION: ${{ matrix.spark }}
SCALA_VERSION: ${{ matrix.scala }}
# Ensure the temporary auth token for this workflow, instead of the
# bundled GitHub PAT from the `remotes` package is used for
# `remotes::install_github()`
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete existing R binaries
run: |
for b in R Rscript
do
while [ -n "$(which "$b")" ]
do
sudo rm -v "$(which "$b")"
done
done
shell: bash
- name: Delete existing JDK installation(s)
run: |
sudo apt-get -y remove --purge default-jdk adoptopenjdk-11-hotspot || :
shell: bash
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.r }}
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: Query R dependencies
run: |
print(R.version)
install.packages("remotes")
saveRDS(remotes::dev_package_deps("./R/", dependencies = TRUE), ".github/deps.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Get OS name
id: os-name
run: |
# `os_name` will be like "Ubuntu-20.04.1-LTS"
OS_NAME=$(lsb_release -ds | sed 's/\s/-/g')
echo "::set-output name=os-name::$OS_NAME"
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@master
with:
path: ${{ env.R_LIBS_USER }}
key: apache.sedona-${{ steps.os-name.outputs.os-name }}-${{ hashFiles('.github/R-version') }}-${{ hashFiles('.github/deps.Rds') }}
restore-keys: apache.sedona-${{ steps.os-name.outputs.os-name }}-${{ hashFiles('.github/R-version') }}
- name: Cache Spark installations
if: runner.os != 'Windows'
uses: actions/cache@master
with:
path: ~/spark
key: apache.sedona-apache-spark-${{ steps.os-name.outputs.os-name }}-${{ env.SPARK_VERSION }}
- name: Install system dependencies
run: source ./.github/workflows/scripts/install_system_deps_for_r_build.sh
- name: Install R dependencies
run: source ./.github/workflows/scripts/install_r_deps.sh
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build Sedona libraries
run: |
if [ ${SPARK_VERSION:0:1} == "3" ]; then
mvn -q clean install -DskipTests -Dscala=${SCALA_VERSION:0:4} -Dspark=3.0 -Dgeotools
else
mvn -q clean install -DskipTests -Dscala=${SCALA_VERSION:0:4} -Dspark=2.4 -Dgeotools
fi
- name: Build R package
env:
WARNINGS_ARE_ERRORS: 1
run: R CMD build --no-build-vignettes ./R
- name: Check
env:
_R_CHECK_FORCE_SUGGESTS_: false
WARNINGS_ARE_ERRORS: 1
run: |
R CMD check --no-build-vignettes --no-manual --no-tests apache.sedona*.tar.gz
rm -f apache.sedona*.tar.gz
- name: Install apache.sedona from source
run: Rscript -e 'install.packages("./R/", repos = NULL, type = "source")'
- name: Run tests
run: |
export SPARKLYR_LOG_FILE='/tmp/sparklyr.log'
source ./.github/workflows/scripts/prepare_sparklyr_sedona_test_env.sh
echo "Apache Sedona jar files: ${SEDONA_JAR_FILES}"
cd ./R/tests
NOT_CRAN='true' Rscript testthat.R
shell: bash
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Worker logs
path: /tmp/sparklyr.log
- name: Dump worker logs on failure
if: failure()
run: cat /tmp/sparklyr.log