-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add native worker-specific github workflows
- Loading branch information
Showing
5 changed files
with
163 additions
and
11 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# 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: | ||
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 | ||
|
||
- name: Format check | ||
run: presto-native-execution/velox/scripts/check.py format master | ||
|
||
- name: Header check | ||
run: presto-native-execution/velox/scripts/check.py header master | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters