forked from prestodb/presto
100 lines (83 loc) · 4.07 KB
/
test-native.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Licensed 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: test native
on:
pull_request:
env:
MAVEN_OPTS: "-Xmx1024M -XX:+ExitOnOutOfMemoryError"
MAVEN_INSTALL_OPTS: "-Xmx2G -XX:+ExitOnOutOfMemoryError"
MAVEN_FAST_INSTALL: "-B -V -T C1 -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true"
MAVEN_TEST: "-B -Dair.check.skip-all -Dmaven.javadoc.skip=true -DLogTestDurationListener.enabled=true --fail-at-end"
jobs:
build-and-test:
runs-on: ubuntu-latest
container: prestocpp/prestocpp-avx-centos:root-20230613
env:
CC: /opt/rh/gcc-toolset-9/root/bin/gcc
CXX: /opt/rh/gcc-toolset-9/root/bin/g++
concurrency:
group: ${{ github.workflow }}-native-build-and-test-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Get key for ccache
id: get-ccache-key
run: echo "CCACHE_KEY=$(/bin/date -u "+%Y-%U")" >> "$GITHUB_OUTPUT"
- name: Setup ccache cache
id: presto_cpp_ccache
uses: actions/cache@v3
with:
path: ${GITHUB_WORKSPACE}/.ccache
key: ${{ runner.os }}-presto-native-ccache-${{ steps.get-ccache-key.outputs.CCACHE_KEY }}
- name: Initiate ccache
if: steps.presto_cpp_ccache.outputs.cache-hit != 'true'
run: |
rm -rf ${GITHUB_WORKSPACE}/.ccache
mkdir -p ${GITHUB_WORKSPACE}/.ccache
export CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache
ccache -sz -M 6Gi
- name: Build presto_cpp
run: |
source /opt/rh/gcc-toolset-9/enable
export CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache
ccache -s
cd ${GITHUB_WORKSPACE}/presto-native-execution
make velox-submodule
cmake -B _build/debug -GNinja -DTREAT_WARNINGS_AS_ERRORS=1 -DENABLE_ALL_WARNINGS=1 -DCMAKE_BUILD_TYPE=Debug -DPRESTO_ENABLE_PARQUET=ON -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
ninja -C _build/debug -j 1
ccache -s
- name: Run unit tests
run: |
cd ${GITHUB_WORKSPACE}/presto-native-execution/_build/debug
ctest -j 1 -VV --output-on-failure --exclude-regex velox.*
- name: Delete build files
run: |
cd ${GITHUB_WORKSPACE}/presto-native-execution/_build/debug
# Delete static libraries
rm `find ./ -name lib\*.a`
- name: Maven Install
run: |
export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}"
# build all dependent components of presto-native-execution
./mvnw clean install ${MAVEN_FAST_INSTALL} -pl 'presto-native-execution' -am
- name: Run presto-native e2e tests
run: |
rm -rf /tmp/hive_data/tpch/
for test in $(find ${GITHUB_WORKSPACE}/presto-native-execution/src/test -name 'TestPrestoNative*.java' | grep -o "Test[a-zA-Z]*"); do
./mvnw test ${MAVEN_TEST} -pl 'presto-native-execution' -Dtest=${test} -DPRESTO_SERVER=${GITHUB_WORKSPACE}/presto-native-execution/_build/debug/presto_cpp/main/presto_server -DDATA_DIR=/tmp/ -Duser.timezone=America/Bahia_Banderas
done
- name: Run spark-native e2e tests
run: |
rm -rf /tmp/hive_data/tpch/
for test in $(find ${GITHUB_WORKSPACE}/presto-native-execution/src/test -name 'TestPrestoSparkNative*.java' | grep -o "Test[a-zA-Z]*"); do
./mvnw test ${MAVEN_TEST} -pl 'presto-native-execution' -Dtest=${test} -DPRESTO_SERVER=${GITHUB_WORKSPACE}/presto-native-execution/_build/debug/presto_cpp/main/presto_server -DDATA_DIR=/tmp/ -Duser.timezone=America/Bahia_Banderas
done