Skip to content

[DO NOT REVIEW] Test Prestissimo with GitHub Action #2

[DO NOT REVIEW] Test Prestissimo with GitHub Action

[DO NOT REVIEW] Test Prestissimo with GitHub Action #2

name: Prestissimo check and build
on:
push:
branches:
- 'master'
paths:
- 'presto-native-execution/**'
- '.github/workflows/prestissimo-build.yml'
pull_request:
paths:
- 'presto-native-execution/**'
- '.github/workflows/prestissimo-build.yml'
permissions:
contents: read
concurrency:
group: prestissimo-check-and-build-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
format-check:
name: Format check
# prevent errors when forks ff their main branch
if: ${{ github.repository == 'prestodb/presto' }}
runs-on: prestissimo_x64
container: public.ecr.aws/oss-presto/velox-dev:check
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fix git permissions
# 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: Check formatting
run: |
cd presto-native-execution
make format-check
header-check:
name: Header check
if: ${{ github.repository == 'prestodb/presto' }}
runs-on: prestissimo_x64
container: public.ecr.aws/oss-presto/velox-dev:check
needs: format-check
steps:
- name: Check license headers
run: |
cd presto-native-execution
make header-check
linux-build-all:
name: Linux build all
if: ${{ github.repository == 'prestodb/presto' }}
runs-on: prestissimo_x64
container: prestodb/presto-native-dependency:latest
needs: header-check
env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fix git permissions
# 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 submodule
run: |
cd presto-native-execution
make velox-submodule
- name: Install all adapter dependencies
run: |
mkdir -p ${HOME}/adapter-deps/install
source /opt/rh/gcc-toolset-12/enable
set -xu
cd presto-native-execution
DEPENDENCY_DIR=${HOME}/adapter-deps PROMPT_ALWAYS_RESPOND=n ./scripts/setup-adapters.sh jwt
- name: Get Ccache Stash
uses: assignUser/stash/restore@v1
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-ubuntu-release
- name: Build all
run: |
mkdir -p '${{ env.CCACHE_DIR }}'
ccache -sz -M 8Gi
source /opt/rh/gcc-toolset-12/enable
cd presto-native-execution
cmake \
-B _build/release \
-GNinja \
-DAWSSDK_ROOT_DIR=${HOME}/adapter-deps/install \
-DTREAT_WARNINGS_AS_ERRORS=1 \
-DENABLE_ALL_WARNINGS=1 \
-DCMAKE_BUILD_TYPE=Release \
-DPRESTO_ENABLE_PARQUET=ON \
-DPRESTO_ENABLE_S3=ON \
-DPRESTO_ENABLE_REMOTE_FUNCTIONS=ON \
-DPRESTO_ENABLE_JWT=ON \
-DCMAKE_PREFIX_PATH=/usr/local \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMAX_LINK_JOBS=2
ninja -C _build/release -j 8
ccache -vs
- uses: assignUser/stash/save@v1
with:
path: '${{ env.CCACHE_DIR }}'
key: ccache-ubuntu-release