-
Notifications
You must be signed in to change notification settings - Fork 303
Expand file tree
/
Copy pathaction.yaml
More file actions
112 lines (108 loc) · 4.13 KB
/
action.yaml
File metadata and controls
112 lines (108 loc) · 4.13 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
# 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: ''
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@v5
with:
path: |
~/.m2/repository
/root/.m2/repository
key: ${{ runner.os }}-java-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-java-maven-
- name: Run all tests
shell: bash
if: ${{ inputs.suites == '' }}
env:
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 install ${{ inputs.maven_opts }}
- name: Run specified tests
shell: bash
if: ${{ inputs.suites != '' }}
env:
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 install ${{ inputs.maven_opts }}
- name: Upload crash logs
if: failure()
uses: actions/upload-artifact@v6
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@v6
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@v6
with:
name: java-test-reports-${{ inputs.artifact_name }}
path: "**/target/surefire-reports/*.txt"
retention-days: 7 # 1 week for test reports
overwrite: true