Skip to content

Native inlined sql functions module #12

Native inlined sql functions module

Native inlined sql functions module #12

name: prestocpp-linux-build
on:
workflow_dispatch:
pull_request:
jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
codechange: ${{ steps.filter.outputs.codechange }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
codechange:
- '!presto-docs/**'
prestocpp-linux-build-engine:
runs-on: ubuntu-22.04
needs: changes
container:
image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e
concurrency:
group: ${{ github.workflow }}-prestocpp-linux-build-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
CCACHE_DIR: "${{ github.workspace }}/ccache"
CC: /usr/bin/clang-15
CXX: /usr/bin/clang++-15
BUILD_SCRIPT: |
cd presto-native-execution
cmake \
-B _build/debug \
-GNinja \
-DTREAT_WARNINGS_AS_ERRORS=1 \
-DENABLE_ALL_WARNINGS=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DPRESTO_ENABLE_S3=ON \
-DPRESTO_ENABLE_GCS=ON \
-DPRESTO_ENABLE_ABFS=OFF \
-DPRESTO_ENABLE_HDFS=ON \
-DPRESTO_ENABLE_REMOTE_FUNCTIONS=ON \
-DPRESTO_ENABLE_JWT=ON \
-DPRESTO_STATS_REPORTER_TYPE=PROMETHEUS \
-DPRESTO_MEMORY_CHECKER_TYPE=LINUX_MEMORY_CHECKER \
-DPRESTO_ENABLE_TESTING=OFF \
-DCMAKE_PREFIX_PATH=/usr/local \
-DThrift_ROOT=/usr/local \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMAX_LINK_JOBS=4
ninja -C _build/debug -j 4
steps:
- uses: actions/checkout@v4
if: needs.changes.outputs.codechange == 'true'
- name: Fix git permissions
if: needs.changes.outputs.codechange == 'true'
# Usually actions/checkout does this but as we run in a container
# it doesn't work
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Update velox
if: needs.changes.outputs.codechange == 'true'
run: |
cd presto-native-execution
make velox-submodule
- name: Install Github CLI for using apache/infrastructure-actions/stash
if: needs.changes.outputs.codechange == 'true'
run: |
curl -L https://github.com/cli/cli/releases/download/v2.63.2/gh_2.63.2_linux_amd64.rpm > gh_2.63.2_linux_amd64.rpm
rpm -iv gh_2.63.2_linux_amd64.rpm
- uses: apache/infrastructure-actions/stash/restore@4ab8682fbd4623d2b4fc1c98db38aba5091924c3
if: needs.changes.outputs.codechange == 'true'
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-prestocpp-linux-build-engine
- name: Zero ccache statistics
if: needs.changes.outputs.codechange == 'true'
run: ccache -sz
- name: Remove files not needed for the build
if: needs.changes.outputs.codechange == 'true'
run: |
find . -name data | xargs rm -r
find . -name tests | xargs rm -r
find . -name test | xargs rm -rf
- name: Disk space consumption before build
if: needs.changes.outputs.codechange == 'true'
run: df
- name: Generate build command script for reuse
if: needs.changes.outputs.codechange == 'true'
run: |
- name: Build engine
if: needs.changes.outputs.codechange == 'true'
run: |
eval ${{ env.BUILD_SCRIPT }}
- name: Disk space consumption after build
if: needs.changes.outputs.codechange == 'true'
run: df
- name: Ccache after
if: needs.changes.outputs.codechange == 'true'
run: ccache -s
- uses: apache/infrastructure-actions/stash/save@4ab8682fbd4623d2b4fc1c98db38aba5091924c3
if: needs.changes.outputs.codechange == 'true'
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-prestocpp-linux-build-engine
- name: Regenerate the protocol files
if: needs.changes.outputs.codechange == 'true'
run: |
export PRESTO_HOME=$(pwd)
cd presto-native-execution
make presto_protocol
- name: Incrementally rebuild presto_server with the new protocol
if: needs.changes.outputs.codechange == 'true'
run: |
eval ${{ env.BUILD_SCRIPT }}