Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEDONA-256] R GitHub workflow update #786

Merged
merged 6 commits into from
Mar 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 26 additions & 41 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,69 +41,54 @@ 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
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'
Expand Down