forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (125 loc) · 5.44 KB
/
test-native-specific.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
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
# 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-specific
on:
pull_request:
paths:
- 'presto-native-execution/**'
jobs:
native-specific-macos:
if: ${{ false }} # disable the macos run for now
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.5.1'
- name: Update submodules
run: make -C presto-native-execution submodules
- name: Setup MacOS cache
id: presto_cpp_macos_dep_cache
uses: actions/cache@v3
with:
path: ~/deps
key: ${{ runner.os }}-presto-native-macos-cache-${{ hashFiles('.github/workflows/test-native-specific.yml') }}-${{ hashFiles('presto-native-execution/scripts/setup-macos.sh') }}-${{ hashFiles('presto-native-execution/velox/scripts/setup-macos.sh') }}
restore-keys: |
${{ runner.os }}-presto-native-macos-cache-
- name: Initiate MacOS cache
if: steps.presto_cpp_macos_dep_cache.outputs.cache-hit != 'true'
run: |
set -xu
mkdir ~/deps ~/deps-src
git clone --depth 1 https://github.com/Homebrew/brew ~/deps
PATH=~/deps/bin:${PATH}
DEPENDENCY_DIR=~/deps-src INSTALL_PREFIX=~/deps PROMPT_ALWAYS_RESPOND=n ${GITHUB_WORKSPACE}/presto-native-execution/scripts/setup-macos.sh
# Calculate the prefix path before we delete brew's repos and taps.
echo "$(pwd)/deps;$(brew --prefix [email protected]);$(brew --prefix icu4c)" > ~/deps/PREFIX_PATH
rm -rf ~/deps/.git ~/deps/Library/Taps/ # Reduce cache size by 70%.
rm -rf ~/deps-src
- name: Setup MacOS ccache cache
id: presto_cpp_macos_ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ runner.os }}-presto-native-macos-ccache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-presto-native-macos-ccache-
- name: Initiate ccache for MacOS
if: steps.presto_cpp_macos_ccache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.ccache
export PATH=~/deps/bin:${PATH}
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -sz -M 5Gi
- name: Build presto_cpp on MacOS
run: |
export PATH=~/deps/bin:${PATH}
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -s
cd ${GITHUB_WORKSPACE}/presto-native-execution
cmake -B _build/debug -GNinja -DTREAT_WARNINGS_AS_ERRORS=1 -DENABLE_ALL_WARNINGS=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$(cat ~/deps/PREFIX_PATH) -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
ninja -C _build/debug
ccache -s
native-specific-linux:
runs-on: ubuntu-latest
container: prestocpp/prestocpp-avx-circleci:mikesh-20220804
env:
CC: /opt/rh/gcc-toolset-9/root/bin/gcc
CXX: /opt/rh/gcc-toolset-9/root/bin/g++
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
fetch-depth: 0
- name: Update submodules
run: make -C presto-native-execution submodules
# disable the checks for now until the image if fixed to have cmake-format.
# - name: Format check
# run: make -C presto-native-execution format-check
#
# - name: Header check
# run: make -C presto-native-execution header-check
- name: Get date for ccache
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: Setup ccache cache
id: presto_cpp_ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ runner.os }}-presto-native-ccache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-presto-native-ccache-
- name: Initiate ccache
if: steps.presto_cpp_ccache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.ccache
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -sz -M 5Gi
- name: Install S3 adapter dependencies
run: |
mkdir ~/adapter-deps ~/adapter-deps/install
source /opt/rh/gcc-toolset-9/enable
set -xu
DEPENDENCY_DIR=~/adapter-deps PROMPT_ALWAYS_RESPOND=n ${GITHUB_WORKSPACE}/presto-native-execution/velox/scripts/setup-adapters.sh
- name: Build presto_cpp
run: |
source /opt/rh/gcc-toolset-9/enable
export CCACHE_DIR=$(realpath ~/.ccache)
ccache -s
cd ${GITHUB_WORKSPACE}/presto-native-execution
cmake -B _build/release -GNinja -DAWSSDK_ROOT_DIR=~/adapter-deps/install -DTREAT_WARNINGS_AS_ERRORS=1 -DENABLE_ALL_WARNINGS=1 -DCMAKE_BUILD_TYPE=Release -DPRESTO_ENABLE_PARQUET=ON -DPRESTO_ENABLE_S3=ON -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
ninja -C _build/release -j 2
ccache -s