Skip to content

Tag the unary expression so we can auto include in the book. #141

Tag the unary expression so we can auto include in the book.

Tag the unary expression so we can auto include in the book. #141

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:
spark:
- 2.4.8
- 3.0.2
- 3.1.2
- 3.2.2
- 3.3.1
- 3.4.0
- 3.4.1
- 3.5.0
env:
SPARK_VERSION: ${{ matrix.spark }}
steps:
- name: Checkout spark-testing-base
uses: actions/[email protected]
# In order to fetch changed files
# with:
# fetch-depth: 0
# repository: holdenk/spark-testing-base
# ref: main
- name: Cache maven modules
id: cache-maven
uses: actions/[email protected]
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='[email protected]' merge --no-commit --progress --squash FETCH_HEAD
# git -c user.name='Spark Test Account' -c user.email='[email protected]' 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