-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afb0841
commit 3b4dfd6
Showing
4 changed files
with
89 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Build | ||
description: Build YDB SDK | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Prepare VM for YDB SDK build | ||
description: Install required packages | ||
|
||
runs: | ||
using: "composite" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,43 +3,25 @@ name: PR-check | |
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- release-* | ||
pull_request: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 12 * * *" | ||
|
||
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 | ||
uses: ./.github/actions/prepare_vm | ||
- 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] | ||
- name: Restore cache files | ||
uses: actions/restore@v4 | ||
with: | ||
path: ../.ccache | ||
key: ubuntu-22.04-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} | ||
|
@@ -53,22 +35,5 @@ jobs: | |
- 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 | ||
uses: ./.github/actions/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Warm up cache | ||
|
||
on: | ||
schedule: | ||
- cron: "0 12 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
main: | ||
name: Build YDB C++ SDK and cache artifacts | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Install dependencies | ||
uses: ./.github/actions/prepare_vm | ||
- 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/cache@v4 | ||
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: Build | ||
uses: ./.github/actions/build |