forked from delta-io/delta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INFRA] Fix and create new workflow to compile delta-spark examples (d…
…elta-io#3011) #### Which Delta project/connector is this regarding? - [ ] Spark - [ ] Standalone - [ ] Flink - [ ] Kernel - [X] Other (INFRA) ## Description Create new workflow `spark_examples_test.yaml` that compiles the `examples/scala/build.sbt` project. Also fixes such compilation so that it uses the local jars (previously it was incorrectly hardcoded to Delta 3.0). This requires running `publishM2` beforehand. ## How was this patch tested? CI tests and specifically tested on a commit that uses a new `clusterBy` API in 3.2: delta-io#3012 ## Does this PR introduce _any_ user-facing changes? No.
- Loading branch information
1 parent
d68c54e
commit d90d021
Showing
3 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "Delta Spark Local Publishing and Examples Compilation" | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
# These Scala versions must match those in the build.sbt | ||
scala: [2.12.18, 2.13.13] | ||
env: | ||
SCALA_VERSION: ${{ matrix.scala }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: technote-space/get-diff-action@v4 | ||
id: git-diff | ||
with: | ||
PATTERNS: | | ||
** | ||
.github/workflows/** | ||
!kernel/** | ||
!connectors/** | ||
- name: install java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "8" | ||
- name: Cache Scala, SBT | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.sbt | ||
~/.ivy2 | ||
~/.cache/coursier | ||
# Change the key if dependencies are changed. For each key, GitHub Actions will cache the | ||
# the above directories when we use the key for the first time. After that, each run will | ||
# just use the cache. The cache is immutable so we need to use a new key when trying to | ||
# cache new stuff. | ||
key: delta-sbt-cache-spark-examples-scala${{ matrix.scala }} | ||
- name: Install Job dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | ||
sudo apt install libedit-dev | ||
if: steps.git-diff.outputs.diff | ||
- name: Run Delta Spark Local Publishing and Examples Compilation | ||
# examples/scala/build.sbt will compile against the local Delta relase version (e.g. 3.2.0-SNAPSHOT). | ||
# Thus, we need to publishM2 first so those jars are locally accessible. | ||
# We publish storage explicitly so that it is available for the Scala 2.13 build. As a java project | ||
# it is typically only released when publishing for Scala 2.12. | ||
run: | | ||
build/sbt clean | ||
build/sbt storage/publishM2 | ||
build/sbt "++ $SCALA_VERSION publishM2" | ||
cd examples/scala && build/sbt "++ $SCALA_VERSION compile" | ||
if: steps.git-diff.outputs.diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters