|
| 1 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | +# you may not use this file except in compliance with the License. |
| 3 | +# You may obtain a copy of the License at |
| 4 | +# |
| 5 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +# |
| 7 | +# Unless required by applicable law or agreed to in writing, software |
| 8 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | +# See the License for the specific language governing permissions and |
| 11 | +# limitations under the License. |
| 12 | +name: test native-specific |
| 13 | + |
| 14 | +on: |
| 15 | + pull_request: |
| 16 | + paths: |
| 17 | + - 'presto-native-execution/**' |
| 18 | + |
| 19 | +jobs: |
| 20 | + native-specific-macos: |
| 21 | + runs-on: macos-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v3 |
| 24 | + - uses: maxim-lobanov/setup-xcode@v1 |
| 25 | + with: |
| 26 | + xcode-version: '12.5.1' |
| 27 | + |
| 28 | + - name: Update submodules |
| 29 | + run: make -C presto-native-execution submodules |
| 30 | + |
| 31 | + - name: Setup MacOS cache |
| 32 | + id: presto_cpp_macos_dep_cache |
| 33 | + uses: actions/cache@v3 |
| 34 | + with: |
| 35 | + path: ~/deps |
| 36 | + 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') }} |
| 37 | + restore-keys: | |
| 38 | + ${{ runner.os }}-presto-native-macos-cache- |
| 39 | +
|
| 40 | + - name: Initiate MacOS cache |
| 41 | + if: steps.presto_cpp_macos_dep_cache.outputs.cache-hit != 'true' |
| 42 | + run: | |
| 43 | + set -xu |
| 44 | + mkdir ~/deps ~/deps-src |
| 45 | + git clone --depth 1 https://github.com/Homebrew/brew ~/deps |
| 46 | + PATH=~/deps/bin:${PATH} |
| 47 | + DEPENDENCY_DIR=~/deps-src INSTALL_PREFIX=~/deps PROMPT_ALWAYS_RESPOND=n ${GITHUB_WORKSPACE}/presto-native-execution/scripts/setup-macos.sh |
| 48 | + # Calculate the prefix path before we delete brew's repos and taps. |
| 49 | + echo "$(pwd)/deps;$(brew --prefix [email protected]);$(brew --prefix icu4c)" > ~/deps/PREFIX_PATH |
| 50 | + rm -rf ~/deps/.git ~/deps/Library/Taps/ # Reduce cache size by 70%. |
| 51 | + rm -rf ~/deps-src |
| 52 | +
|
| 53 | + - name: Setup MacOS ccache cache |
| 54 | + id: presto_cpp_macos_ccache |
| 55 | + uses: actions/cache@v3 |
| 56 | + with: |
| 57 | + path: ~/.ccache |
| 58 | + key: ${{ runner.os }}-presto-native-macos-ccache-${{ steps.get-date.outputs.date }} |
| 59 | + restore-keys: | |
| 60 | + ${{ runner.os }}-presto-native-macos-ccache- |
| 61 | +
|
| 62 | + - name: Initiate ccache for MacOS |
| 63 | + if: steps.presto_cpp_macos_ccache.outputs.cache-hit != 'true' |
| 64 | + run: | |
| 65 | + mkdir -p ~/.ccache |
| 66 | + export PATH=~/deps/bin:${PATH} |
| 67 | + export CCACHE_DIR=$(realpath ~/.ccache) |
| 68 | + ccache -sz -M 5Gi |
| 69 | +
|
| 70 | + - name: Build presto_cpp on MacOS |
| 71 | + run: | |
| 72 | + export PATH=~/deps/bin:${PATH} |
| 73 | + export CCACHE_DIR=$(realpath ~/.ccache) |
| 74 | + ccache -s |
| 75 | + cd ${GITHUB_WORKSPACE}/presto-native-execution |
| 76 | + 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 |
| 77 | + ninja -C _build/debug |
| 78 | + ccache -s |
| 79 | +
|
| 80 | + native-specific-linux: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + container: prestocpp/prestocpp-avx-circleci:mikesh-20220804 |
| 83 | + |
| 84 | + env: |
| 85 | + CC: /opt/rh/gcc-toolset-9/root/bin/gcc |
| 86 | + CXX: /opt/rh/gcc-toolset-9/root/bin/g++ |
| 87 | + |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v3 |
| 90 | + with: |
| 91 | + ref: ${{ github.event.pull_request.head.sha }} |
| 92 | + submodules: true |
| 93 | + fetch-depth: 0 |
| 94 | + |
| 95 | + - name: Update submodules |
| 96 | + run: make -C presto-native-execution submodules |
| 97 | + |
| 98 | + - name: Format check |
| 99 | + run: presto-native-execution/velox/scripts/check.py format master |
| 100 | + |
| 101 | + - name: Header check |
| 102 | + run: presto-native-execution/velox/scripts/check.py header master |
| 103 | + |
| 104 | + - name: Get date for ccache |
| 105 | + id: get-date |
| 106 | + run: | |
| 107 | + echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" |
| 108 | + shell: bash |
| 109 | + |
| 110 | + - name: Setup ccache cache |
| 111 | + id: presto_cpp_ccache |
| 112 | + uses: actions/cache@v3 |
| 113 | + with: |
| 114 | + path: ~/.ccache |
| 115 | + key: ${{ runner.os }}-presto-native-ccache-${{ steps.get-date.outputs.date }} |
| 116 | + restore-keys: | |
| 117 | + ${{ runner.os }}-presto-native-ccache- |
| 118 | +
|
| 119 | + - name: Initiate ccache |
| 120 | + if: steps.presto_cpp_ccache.outputs.cache-hit != 'true' |
| 121 | + run: | |
| 122 | + mkdir -p ~/.ccache |
| 123 | + export CCACHE_DIR=$(realpath ~/.ccache) |
| 124 | + ccache -sz -M 5Gi |
| 125 | +
|
| 126 | + - name: Install S3 adapter dependencies |
| 127 | + run: | |
| 128 | + mkdir ~/adapter-deps ~/adapter-deps/install |
| 129 | + source /opt/rh/gcc-toolset-9/enable |
| 130 | + set -xu |
| 131 | + DEPENDENCY_DIR=~/adapter-deps PROMPT_ALWAYS_RESPOND=n ${GITHUB_WORKSPACE}/presto-native-execution/velox/scripts/setup-adapters.sh |
| 132 | +
|
| 133 | + - name: Build presto_cpp |
| 134 | + run: | |
| 135 | + source /opt/rh/gcc-toolset-9/enable |
| 136 | + export CCACHE_DIR=$(realpath ~/.ccache) |
| 137 | + ccache -s |
| 138 | + cd ${GITHUB_WORKSPACE}/presto-native-execution |
| 139 | + 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 |
| 140 | + ninja -C _build/release -j 2 |
| 141 | + ccache -s |
0 commit comments