Skip to content

Commit 63e73c3

Browse files
committed
Refactor build system and CI configuration
- Removed unused GitHub workflows: - metrics.yml (unused metrics collection) - single_platform.yml (redundant build workflow) - Improved CMake configuration: - Made lld linker optional with fall
1 parent bab239c commit 63e73c3

File tree

8 files changed

+241
-169
lines changed

8 files changed

+241
-169
lines changed

.github/workflows/metrics.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/single_platform.yml

Lines changed: 0 additions & 111 deletions
This file was deleted.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CMake on Fedora with Boost 1.88
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
env:
10+
BUILD_TYPE: Release
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
container:
17+
image: fedora:latest
18+
19+
steps:
20+
- name: Install Git
21+
run: |
22+
dnf install -y git
23+
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
submodules: recursive
29+
30+
- name: Install Development Tools and Dependencies
31+
run: |
32+
dnf install -y \
33+
gcc gcc-c++ glibc-devel cmake ninja-build wget tar \
34+
openssl-devel libcurl-devel libuv-devel \
35+
python3-devel protobuf-compiler protobuf-devel \
36+
xz-devel make which gawk lld
37+
38+
- name: Download and install Boost 1.88.0
39+
run: |
40+
echo "⏳ Fetching latest Boost release info..."
41+
HTML=$(curl -s https://www.boost.org/releases/latest/)
42+
BOOST_URL=$(echo "$HTML" | grep -oP 'https://[^"]+boost_1_[0-9_]+\.tar\.gz' | head -n 1)
43+
BOOST_FILE=$(basename "$BOOST_URL")
44+
BOOST_DIR="${BOOST_FILE%.tar.gz}"
45+
HASH=$(echo "$HTML" | tr '\n' ' ' | grep -oP "${BOOST_FILE}.*?title=\"\K[a-f0-9]{64}")
46+
47+
if [ -z "$BOOST_URL" ] || [ -z "$HASH" ]; then
48+
echo "❌ Failed to find Boost archive or SHA256 hash"
49+
exit 1
50+
fi
51+
52+
echo "📥 Downloading Boost: $BOOST_FILE"
53+
curl -LO "$BOOST_URL"
54+
55+
echo "🔍 Verifying SHA256..."
56+
LOCAL_HASH=$(sha256sum "$BOOST_FILE" | awk '{print $1}')
57+
if [ "$HASH" != "$LOCAL_HASH" ]; then
58+
echo "❌ SHA256 mismatch: $LOCAL_HASH != $HASH"
59+
exit 1
60+
fi
61+
62+
echo "✅ SHA256 verified. Extracting..."
63+
tar -xzf "$BOOST_FILE"
64+
65+
echo "🔧 Installing Boost..."
66+
cd "$BOOST_DIR"
67+
./bootstrap.sh
68+
69+
# sudo для установки в /usr/local (можно убрать, если CI запускается с root)
70+
./b2 install
71+
72+
echo "✅ Boost installed to /usr/local"
73+
74+
# cleanup, если хочешь:
75+
cd ..
76+
rm -rf "$BOOST_DIR" "$BOOST_FILE"
77+
78+
- name: Configure CMake Debug
79+
run: cmake --preset configure_dbg
80+
81+
- name: Configure CMake Release
82+
run: cmake --preset configure_release
83+
84+
- name: Build Debug
85+
run: cmake --build --preset build_dbg -- -j$(nproc)
86+
87+
- name: Build Release
88+
run: cmake --build --preset build_release -- -j$(nproc)
89+
90+
- name: Run Tests
91+
run: ctest --preset tests
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CMake on a single platform with latest Boost
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
env:
10+
BUILD_TYPE: Release
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
container:
16+
image: ubuntu:24.04
17+
steps:
18+
- name: Install Git
19+
run: |
20+
apt update
21+
apt install -y git
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
submodules: "recursive"
27+
28+
- name: Install GCC 14
29+
run: |
30+
export DEBIAN_FRONTEND=noninteractive
31+
apt-get update
32+
apt-get install -y tzdata software-properties-common wget gnupg2 lsb-release build-essential
33+
ln -fs /usr/share/zoneinfo/Europe/Moscow /etc/localtime
34+
dpkg-reconfigure --frontend noninteractive tzdata
35+
36+
add-apt-repository ppa:ubuntu-toolchain-r/test -y
37+
apt-get update
38+
apt-get install -y gcc-14 g++-14
39+
40+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
41+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14
42+
43+
gcc --version
44+
g++ --version
45+
46+
- name: Install system dependencies
47+
run: |
48+
apt-get update
49+
apt-get install -y \
50+
build-essential \
51+
cmake \
52+
curl \
53+
libssl-dev \
54+
python3-dev \
55+
libcurl4-openssl-dev \
56+
libuv1-dev \
57+
librdkafka-dev \
58+
protobuf-compiler \
59+
libprotobuf-dev \
60+
ninja-build
61+
62+
- name: Download and install latest Boost
63+
run: |
64+
echo "⏳ Fetching latest Boost release info..."
65+
HTML=$(curl -s https://www.boost.org/releases/latest/)
66+
BOOST_URL=$(echo "$HTML" | grep -oP 'https://[^"]+boost_1_[0-9_]+\.tar\.gz' | head -n 1)
67+
BOOST_FILE=$(basename "$BOOST_URL")
68+
BOOST_DIR="${BOOST_FILE%.tar.gz}"
69+
HASH=$(echo "$HTML" | tr '\n' ' ' | grep -oP "${BOOST_FILE}.*?title=\"\K[a-f0-9]{64}")
70+
71+
if [[ -z "$BOOST_URL" || -z "$HASH" ]]; then
72+
echo "❌ Failed to find Boost archive or SHA256 hash"
73+
exit 1
74+
fi
75+
76+
echo "📥 Downloading Boost: $BOOST_FILE"
77+
curl -LO "$BOOST_URL"
78+
79+
echo "🔍 Verifying SHA256..."
80+
LOCAL_HASH=$(sha256sum "$BOOST_FILE" | awk '{print $1}')
81+
if [[ "$HASH" != "$LOCAL_HASH" ]]; then
82+
echo "❌ SHA256 mismatch: $LOCAL_HASH != $HASH"
83+
exit 1
84+
fi
85+
86+
echo "✅ SHA256 verified. Extracting..."
87+
tar -xzf "$BOOST_FILE"
88+
89+
echo "🔧 Installing Boost..."
90+
cd "$BOOST_DIR"
91+
./bootstrap.sh
92+
./b2 install --prefix=$GITHUB_WORKSPACE/boost_libs
93+
echo "BOOST_ROOT=$GITHUB_WORKSPACE/boost_libs" >> $GITHUB_ENV
94+
95+
# - name: Git Submodule Update
96+
# run: git submodule update --force --recursive --init --remote
97+
98+
- name: Configure CMake DBG
99+
run: cmake --preset configure_dbg
100+
101+
- name: Configure CMake RELEASE
102+
run: cmake --preset configure_release
103+
104+
- name: Build DBG
105+
run: cmake --build --preset build_dbg -- -j$(nproc)
106+
107+
- name: Build RELEASE
108+
run: cmake --build --preset build_release -- -j$(nproc)
109+
110+
- name: Run Tests
111+
run: ctest --preset tests

0 commit comments

Comments
 (0)