Skip to content

Add support for Spark 4 Preview versions #170

Add support for Spark 4 Preview versions

Add support for Spark 4 Preview versions #170

name: Build and test
on:
pull_request:
paths:
- '**'
push:
branches:
- '**'
- '!branch-*.*'
jobs:
# Build: build spark-testing-base and run the tests for specified modules.
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- spark: "2.4.8"
java-version: "11"
distribution: "temurin"
- spark: "3.0.2"
java-version: "11"
distribution: "temurin"
- spark: "3.1.2"
java-version: "11"
distribution: "temurin"
- spark: "3.2.2"
java-version: "11"
distribution: "temurin"
- spark: "3.3.1"
java-version: "11"
distribution: "temurin"
- spark: "3.4.0"
java-version: "11"
distribution: "temurin"
- spark: "3.4.0"
java-version: "17"
distribution: "temurin"
- spark: "4.0.0-preview2"
java-version: "17"
distribution: "temurin"
env:
SPARK_VERSION: ${{ matrix.spark }}
steps:
- name: Checkout spark-testing-base
uses: actions/checkout@v4.1.1
# In order to fetch changed files
with:
fetch-depth: 0
repository: holdenk/spark-testing-base
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.distribution }}
cache: sbt
- name: Cache maven modules
id: cache-maven
uses: actions/cache@v4.0.0
env:
cache-name: cache-maven
with:
# maven cache files are stored in `~/.m2` & `~/.ivy2` on Linux/macOS
path: |
~/.m2
~/.ivy2/cache
key: ${{ runner.os }}-${{ matrix.spark }}-build-${{ env.cache-name }}-${{ hashFiles('build.sbt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.spark }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.spark }}-build-
${{ runner.os }}-${{ matrix.spark }}-
${{ runner.os }}
# - name: Sync the current branch with the latest in spark-testing-base
# if: github.repository != 'holdenk/spark-testing-base'
# id: sync-branch
# run: |
# apache_spark_ref=`git rev-parse HEAD`
# git fetch https://github.com/$GITHUB_REPOSITORY.git ${GITHUB_REF##*/}
# git -c user.name='Spark Test Account' -c user.email='sparktestacc@gmail.com' merge --no-commit --progress --squash FETCH_HEAD
# git -c user.name='Spark Test Account' -c user.email='sparktestacc@gmail.com' commit -m "Merged commit"
# echo "::set-output name=SPARK_REF::$apache_spark_ref"
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
# Run the tests.
- name: Run tests
run: SPARK_TESTING=yes ./build/sbt clean +compile +test -DsparkVersion=$SPARK_VERSION