-
Notifications
You must be signed in to change notification settings - Fork 307
Expand file tree
/
Copy pathaction.yaml
More file actions
89 lines (83 loc) · 3.34 KB
/
action.yaml
File metadata and controls
89 lines (83 loc) · 3.34 KB
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
87
88
89
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Setup Spark Builder
description: 'Setup Apache Spark to run SQL tests'
inputs:
spark-short-version:
description: 'The Apache Spark short version (e.g., 3.5) to build'
required: true
spark-version:
description: 'The Apache Spark version (e.g., 3.5.8) to build'
required: true
skip-native-build:
description: 'Skip native build (when using pre-built artifact)'
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Clone Spark repo
uses: actions/checkout@v6
with:
repository: apache/spark
path: apache-spark
ref: v${{inputs.spark-version}}
fetch-depth: 1
- name: Setup Spark for Comet
shell: bash
run: |
cd apache-spark
git apply ../dev/diffs/${{inputs.spark-version}}.diff
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
/root/.m2/repository
key: ${{ runner.os }}-spark-sql-${{ hashFiles('spark/**/pom.xml', 'common/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-spark-sql-
- name: Build Comet (with native)
if: ${{ inputs.skip-native-build != 'true' }}
shell: bash
run: |
PROFILES="-Pspark-${{inputs.spark-short-version}}" make release
- name: Build Comet (Maven only, skip native)
if: ${{ inputs.skip-native-build == 'true' }}
shell: bash
run: |
# Native library should already be in native/target/release/
./mvnw install -Prelease -DskipTests -Pspark-${{inputs.spark-short-version}}
- name: Purge partial Maven cache entries
shell: bash
run: |
# Comet's Maven phase resolves the dependency graph and downloads POMs
# for transitive artifacts whose JARs it never actually needs. When sbt
# then resolves Spark's deps, Coursier sees the POM in mavenLocal,
# declares the artifact "found locally", and fails on the missing JAR
# without falling back to Maven Central. Delete those partial entries
# so sbt re-fetches the full artifact remotely.
for repo in "$HOME/.m2/repository" /root/.m2/repository; do
[ -d "$repo" ] || continue
find "$repo" -name '*.pom' | while read -r pom; do
jar="${pom%.pom}.jar"
[ -f "$jar" ] && continue
grep -q '<packaging>jar</packaging>\|<packaging>bundle</packaging>' "$pom" 2>/dev/null || continue
rm -f "$pom" "${pom}.sha1" "${pom%.pom}.pom.lastUpdated" \
"$(dirname "$pom")/_remote.repositories"
done
done