Skip to content

Commit

Permalink
Create prestissimo-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanyzhang committed Nov 3, 2024
1 parent fc9131c commit aa2a06c
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/actions/install-gh-cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Install GitHub CLI
description: Installs the GitHub CLI (gh) on the runner
runs:
using: composite
steps:
- name: Download and install GitHub CLI
shell: bash
run: |
curl -sSL https://github.com/cli/cli/releases/latest/download/gh_$(uname -s)_amd64.tar.gz -o gh.tar.gz
tar -xzf gh.tar.gz
sudo mv gh_*/bin/gh /usr/local/bin/
rm -rf gh.tar.gz gh_*
- name: Verify GitHub CLI installation
shell: bash
run: gh --version
128 changes: 128 additions & 0 deletions .github/workflows/prestissimo-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
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@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: 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: 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: 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: Install GitHub CLI
uses: ./.github/actions/install-gh-cli

- 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

0 comments on commit aa2a06c

Please sign in to comment.