Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PR SDK build workflow #31

Merged
merged 9 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/pr_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: PR-check

on:
push:
branches:
- master
- release-*
pull_request:
workflow_dispatch:

jobs:
main:
name: Build YDB C++ SDK
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y install git cmake ninja-build libidn11-dev ragel yasm
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar -xvzf libiconv-1.15.tar.gz
cd libiconv-1.15
./configure --prefix=/usr/local
sudo make
sudo make install
cd ..
(V=4.8.1; curl -L https://github.com/ccache/ccache/releases/download/v${V}/ccache-${V}-linux-x86_64.tar.xz | \
sudo tar -xJ -C /usr/local/bin/ --strip-components=1 --no-same-owner ccache-${V}-linux-x86_64/ccache)
sudo rm -rf llvm.sh libiconv-1.15
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: Cache files
uses: actions/[email protected]
with:
path: ../.ccache
key: ubuntu-22.04-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: |
ubuntu-22.04-ccache-
- name: Checkout PR
uses: actions/checkout@v3
if: github.event.pull_request.head.sha != ''
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout
uses: actions/checkout@v3
if: github.event.pull_request.head.sha == ''
- name: Configure
shell: bash
run: |
mkdir -p ../build
cd ../build
rm -rf *
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCCACHE_PATH=/usr/local/bin/ccache \
-DCMAKE_TOOLCHAIN_FILE=../ydb-cpp-sdk/clang.toolchain \
../ydb-cpp-sdk
- name: Build
shell: bash
run: |
ccache -z
export CCACHE_DIR=`realpath ../.ccache`
cd ../build
ninja examples/all client/all
ccache -s

10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@

```bash
sudo apt-get -y install git cmake ninja-build libidn11-dev ragel yasm

wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
```

- libiconv: https://www.gnu.org/software/libiconv/
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar -xvzf libiconv-1.15.tar.gz
cd libiconv-1.15
./configure --prefix=/usr/local
sudo make
sudo make install
```

## Create the work directory

Expand Down
Loading