-
-
Notifications
You must be signed in to change notification settings - Fork 357
86 lines (84 loc) · 2.86 KB
/
github-actions-basic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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/[email protected]
# 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/[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