From 5674422b142031fe0956392128f0e1124c59cc0f Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Wed, 15 Nov 2023 16:59:57 +0000 Subject: [PATCH] pass spark location through `SPARK_HOME` env var --- .github/actions/r_build/action.yml | 4 ++++ R/build_r_package.R | 8 +------- R/generate_docs.R | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/actions/r_build/action.yml b/.github/actions/r_build/action.yml index 2ae477c29..c9fa2f231 100644 --- a/.github/actions/r_build/action.yml +++ b/.github/actions/r_build/action.yml @@ -50,11 +50,15 @@ runs: run: | cd R Rscript --vanilla generate_docs.R + env: + SPARK_HOME: /usr/spark-download/unzipped/spark-${{ matrix.spark }}-bin-hadoop3 - name: Build R package shell: bash run: | cd R Rscript --vanilla build_r_package.R + env: + SPARK_HOME: /usr/spark-download/unzipped/spark-${{ matrix.spark }}-bin-hadoop3 - name: Test SparkR package shell: bash run: | diff --git a/R/build_r_package.R b/R/build_r_package.R index 136dcee33..a114736d1 100644 --- a/R/build_r_package.R +++ b/R/build_r_package.R @@ -1,13 +1,7 @@ -spark_location <- "/usr/spark-download/unzipped/spark-3.3.2-bin-hadoop3" -Sys.setenv(SPARK_HOME = spark_location) - +spark_location <- Sys.getenv("SPARK_HOME") library(SparkR, lib.loc = c(file.path(spark_location, "R", "lib"))) - - library(pkgbuild) - - build_mosaic_bindings <- function(){ ## build package pkgbuild::build("sparkR-mosaic/sparkrMosaic") diff --git a/R/generate_docs.R b/R/generate_docs.R index fbce4eb14..4b5fe19b3 100644 --- a/R/generate_docs.R +++ b/R/generate_docs.R @@ -1,6 +1,4 @@ -spark_location <- "/usr/spark-download/unzipped/spark-3.3.2-bin-hadoop3" -Sys.setenv(SPARK_HOME = spark_location) - +spark_location <- Sys.getenv("SPARK_HOME") library(SparkR, lib.loc = c(file.path(spark_location, "R", "lib"))) library(roxygen2)