Skip to content
Open
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
18 changes: 14 additions & 4 deletions .github/actions/prepare_vm/action.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: Prepare VM for YDB SDK build
description: Install required packages

inputs:
mode:
description: "Setup scope: build installs full build dependencies; runtime installs only test runtime dependencies."
required: false
default: build

runs:
using: "composite"
steps:
- name: Install CMake and Ninja
uses: lukka/get-cmake@v3.27.7
- name: Install dependencies
- name: Install runtime dependencies
shell: bash
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
Expand All @@ -15,6 +21,13 @@ runs:
rapidjson-dev zlib1g-dev libxxhash-dev libzstd-dev libsnappy-dev libgtest-dev libgmock-dev \
libbz2-dev liblz4-dev libdouble-conversion-dev libssl-dev libstdc++-13-dev gcc-13 g++-13

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10000
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 10000

- name: Install build dependencies
if: ${{ inputs.mode == 'build' }}
shell: bash
run: |
# Install ccache
(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)
Expand All @@ -30,9 +43,6 @@ runs:
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 10000
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 10000

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10000
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 10000

# Install abseil-cpp
wget -O abseil-cpp-20230802.0.tar.gz https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
tar -xvzf abseil-cpp-20230802.0.tar.gz
Expand Down
34 changes: 33 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,29 @@ jobs:
with:
submodules: true

- name: Prepare coverage cache key
id: coverage-cache-key
shell: bash
run: |
echo "prefix=ubuntu-22.04-coverage-gcc-${{ hashFiles('CMakePresets.json', '**/CMakeLists.txt', 'cmake/**') }}" >> "$GITHUB_OUTPUT"

- name: Restore coverage build cache
id: coverage-build-cache
uses: actions/cache/restore@v4
with:
path: build
key: ${{ steps.coverage-cache-key.outputs.prefix }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ steps.coverage-cache-key.outputs.prefix }}-
ubuntu-22.04-coverage-gcc-

- name: Install dependencies
uses: ./.github/actions/prepare_vm

- name: Configure and build with coverage
shell: bash
run: |
mkdir -p build
rm -rf build/*
cmake --preset coverage-test-gcc
cmake --build build -j"$(nproc)"

Expand All @@ -67,6 +82,9 @@ jobs:
FLAKY_REGEX='(ManyMessages|DiscoveryHang|DescribeHang)'
EXCLUDE_REGEX="${IAM_REGEX}|${FLAKY_REGEX}"

find build -type f \( -name '*.gcda' -o -name '*.gcov' \) -delete
rm -rf build/coverage

ctest -j1 --preset coverage-all -E "${EXCLUDE_REGEX}" --output-on-failure

IAM_CTEST_JOBS=1 ./.github/scripts/run_iam_integration_tests.sh
Expand Down Expand Up @@ -96,3 +114,17 @@ jobs:
name: coverage-report
path: build/coverage/
retention-days: 14

- name: Clean coverage data before cache save
if: github.event_name != 'pull_request' && success()
shell: bash
run: |
find build -type f \( -name '*.gcda' -o -name '*.gcov' \) -delete
rm -rf build/coverage

- name: Save coverage build cache
if: github.event_name != 'pull_request' && success() && steps.coverage-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: build
key: ${{ steps.coverage-cache-key.outputs.prefix }}-${{ github.run_id }}-${{ github.run_attempt }}
77 changes: 21 additions & 56 deletions .github/workflows/release_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,68 +39,33 @@ jobs:
submodules: true
ref: ${{ steps.tag.outputs.ref }}

- name: Prepare Debian package cache key
id: deb-package-cache-key
shell: bash
run: |
echo "prefix=ubuntu-24.04-deb-packages-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'contrib/**', 'include/**', 'library/**', 'plugins/**', 'scripts/build_cpack_deb_packages.sh', 'scripts/generate-debian-directory.sh', 'scripts/googleapis_deb/**', 'src/**', 'third_party/api-common-protos/**', 'tools/**', 'util/**') }}" >> "$GITHUB_OUTPUT"

- name: Restore Debian package build cache
uses: actions/cache/restore@v4
with:
path: |
.deb-ccache
build_googleapis_deb
build-deb
key: ${{ steps.deb-package-cache-key.outputs.prefix }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ steps.deb-package-cache-key.outputs.prefix }}-
ubuntu-24.04-deb-packages-

- name: Build .deb packages in Ubuntu 24.04 container
shell: bash
run: |
mkdir -p artifacts
mkdir -p artifacts .deb-ccache build_googleapis_deb build-deb
docker run --rm --network host \
-e CCACHE_DIR=/source/.deb-ccache \
-v "$PWD:/source" \
ubuntu:24.04 \
bash -c '
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y \
build-essential \
cmake \
pkg-config \
git \
libidn11-dev \
libssl-dev \
zlib1g-dev \
libprotobuf-dev \
protobuf-compiler \
libgrpc++-dev \
protobuf-compiler-grpc \
libbrotli-dev \
liblz4-dev \
libzstd-dev \
libbz2-dev \
libxxhash-dev \
libsnappy-dev \
libdouble-conversion-dev \
libgtest-dev \
libre2-dev \
libc-ares-dev \
rapidjson-dev \
python3 \
python3-six \
ragel \
yasm

cd /source
cmake -S scripts/googleapis_deb -B build_googleapis_deb -DCMAKE_INSTALL_PREFIX=/usr/share/yandex
cmake --build build_googleapis_deb -j$(nproc)
cmake --build build_googleapis_deb --target package
dpkg -i build_googleapis_deb/*.deb

./scripts/generate-debian-directory.sh
cmake -S . -B build-deb \
-DCMAKE_BUILD_TYPE=Release \
-DYDB_SDK_INSTALL=ON \
-DYDB_SDK_EXAMPLES=OFF \
-DYDB_SDK_TESTS=OFF \
-DYDB_SDK_ENABLE_OTEL_METRICS=ON \
-DYDB_SDK_ENABLE_OTEL_TRACE=ON \
-DBUILD_SHARED_LIBS=OFF \
-DYDB_SDK_USE_SYSTEM_GOOGLEAPIS=ON \
-DCMAKE_INSTALL_PREFIX=/usr/share/yandex \
-DCMAKE_PREFIX_PATH="/usr/share/yandex"
cmake --build build-deb --target package -j$(nproc)

cp build_googleapis_deb/*.deb /source/artifacts/
cp build-deb/*.deb /source/artifacts/
'
bash /source/scripts/build_cpack_deb_packages.sh /source/artifacts

- name: Smoke-test generated .deb packages
shell: bash
Expand Down
Loading
Loading