forked from apache/datafusion-comet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
148 lines (138 loc) · 5.1 KB
/
action.yaml
File metadata and controls
148 lines (138 loc) · 5.1 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# 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: "Java Test"
description: "Run Java tests"
inputs:
artifact_name:
description: "Unique name for uploaded artifacts for this run"
required: true
suites:
description: 'Which Scalatest test suites to run'
required: false
default: ''
maven_opts:
description: 'Maven options passed to the mvn command'
required: false
default: ''
scan_impl:
description: 'The default Parquet scan implementation'
required: false
default: 'auto'
upload-test-reports:
description: 'Whether to upload test results including coverage to GitHub'
required: false
default: 'false'
skip-native-build:
description: 'Skip native build (when using pre-built artifact)'
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Run Cargo release build
if: ${{ inputs.skip-native-build != 'true' }}
shell: bash
# it is important that we run the Scala tests against a release build rather than a debug build
# to make sure that no tests are relying on overflow checks that are present only in debug builds
run: |
cd native
cargo build --release
- name: Cache Maven dependencies
# TODO: remove next line after working again
# temporarily work around https://github.com/actions/runner-images/issues/13341
# by disabling caching for macOS
if: ${{ runner.os != 'macOS' }}
uses: actions/cache@v4
with:
path: |
~/.m2/repository
/root/.m2/repository
key: ${{ runner.os }}-java-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-java-maven-
- name: Run Maven compile
shell: bash
run: |
./mvnw -B package -DskipTests scalafix:scalafix -Dscalafix.mode=CHECK -Psemanticdb ${{ inputs.maven_opts }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install prettier
shell: bash
run: |
npm install -g prettier
- name: Run prettier
shell: bash
run: |
npx prettier "**/*.md" --write
- name: Mark workspace as safe for git
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check for any local git changes (such as generated docs)
shell: bash
run: |
./dev/ci/check-working-tree-clean.sh
- name: Run all tests
shell: bash
if: ${{ inputs.suites == '' }}
env:
COMET_PARQUET_SCAN_IMPL: ${{ inputs.scan_impl }}
SPARK_LOCAL_HOSTNAME: "localhost"
SPARK_LOCAL_IP: "127.0.0.1"
run: |
MAVEN_OPTS="-Xmx4G -Xms2G -XX:+UnlockDiagnosticVMOptions -XX:+ShowMessageBoxOnError -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=./hs_err_pid%p.log" SPARK_HOME=`pwd` ./mvnw -B -Prelease clean install ${{ inputs.maven_opts }}
- name: Run specified tests
shell: bash
if: ${{ inputs.suites != '' }}
env:
COMET_PARQUET_SCAN_IMPL: ${{ inputs.scan_impl }}
SPARK_LOCAL_HOSTNAME: "localhost"
SPARK_LOCAL_IP: "127.0.0.1"
run: |
MAVEN_SUITES="$(echo "${{ inputs.suites }}" | paste -sd, -)"
echo "Running with MAVEN_SUITES=$MAVEN_SUITES"
MAVEN_OPTS="-Xmx4G -Xms2G -DwildcardSuites=$MAVEN_SUITES -XX:+UnlockDiagnosticVMOptions -XX:+ShowMessageBoxOnError -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=./hs_err_pid%p.log" SPARK_HOME=`pwd` ./mvnw -B -Prelease clean install ${{ inputs.maven_opts }}
- name: Upload crash logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: crash-logs-${{ inputs.artifact_name }}
path: "**/hs_err_pid*.log"
- name: Debug listing
if: failure()
shell: bash
run: |
echo "CWD: $(pwd)"
ls -lah .
ls -lah target
find . -name 'unit-tests.log'
- name: Upload unit-tests.log
if: failure()
uses: actions/upload-artifact@v4
with:
name: unit-tests-${{ inputs.artifact_name }}
path: "**/target/unit-tests.log"
- name: Upload test results
if: ${{ inputs.upload-test-reports == 'true' }}
uses: actions/upload-artifact@v4
with:
name: java-test-reports-${{ inputs.artifact_name }}
path: "**/target/surefire-reports/*.txt"
retention-days: 7 # 1 week for test reports
overwrite: true