You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2023/03/05 05:48:37 UTC

[sedona] branch master updated: [SEDONA-256] R GitHub workflow update (#786)

This is an automated email from the ASF dual-hosted git repository.

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new c8891c69 [SEDONA-256] R GitHub workflow update (#786)
c8891c69 is described below

commit c8891c69de234fcb0a02dbf01cbabfc73938f5ab
Author: gregleleu <33...@users.noreply.github.com>
AuthorDate: Sun Mar 5 00:48:32 2023 -0500

    [SEDONA-256] R GitHub workflow update (#786)
---
 .github/workflows/r.yml | 67 +++++++++++++++++++------------------------------
 1 file changed, 26 insertions(+), 41 deletions(-)

diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml
index 75cfa677..32acdfe3 100644
--- a/.github/workflows/r.yml
+++ b/.github/workflows/r.yml
@@ -41,49 +41,47 @@ jobs:
         run: |
           sudo apt-get -y remove --purge default-jdk adoptopenjdk-11-hotspot || :
         shell: bash
-      - uses: actions/checkout@v2
-      - uses: r-lib/actions/setup-r@v2-branch
+      - uses: actions/checkout@v3
+      - uses: r-lib/actions/setup-r@v2
         with:
           r-version: ${{ matrix.r }}
-      - uses: actions/setup-java@v1
+          use-public-rspm: true
+      - name: Query R dependencies
+        uses: r-lib/actions/setup-r-dependencies@v2
+        with:
+          cache: true
+          extra-packages: |
+            any::testthat
+            any::rcmdcheck
+          working-directory : './R'
+      - name: Build and check R package
+        uses: r-lib/actions/check-r-package@v2
+        with:
+          build_args: 'c("--no-build-vignettes", "--no-manual")'
+          args: 'c("--no-build-vignettes", "--no-manual", "--no-tests")'
+          error-on: '"error"'
+          working-directory: './R'
+        env:
+          _R_CHECK_FORCE_SUGGESTS_: false
+      - name: Install apache.sedona from source
+        run: Rscript -e 'install.packages("./R/", repos = NULL, type = "source")'
+      - uses: actions/setup-java@v3
         with:
+          distribution: 'temurin'
           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}
+          cache: 'maven'
       - 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') }}
+          echo "os-name=$OS_NAME" >> $GITHUB_OUTPUT
       - 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
@@ -91,19 +89,6 @@ jobs:
           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'