-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: explicitly specify required boost components in vcpkg installation
Co-Authored-By: Serg Kryvonos <[email protected]>
- Loading branch information
1 parent
d41bc2d
commit 6ed0df2
Showing
1 changed file
with
123 additions
and
0 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,123 @@ | ||
name: C/C++ CI Ubuntu | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-in-ubuntu: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | ||
VCPKG_DEFAULT_TRIPLET: x64-linux | ||
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Cache vcpkg | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ github.workspace }}/vcpkg | ||
!${{ github.workspace }}/vcpkg/buildtrees | ||
!${{ github.workspace }}/vcpkg/packages | ||
!${{ github.workspace }}/vcpkg/downloads | ||
${{ github.workspace }}/build/bin/Db*.solutions | ||
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-vcpkg- | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential cmake ninja-build autoconf automake autoconf-archive | ||
cmake --version | ||
ninja --version | ||
gcc --version | ||
g++ --version | ||
- name: Setup vcpkg | ||
run: | | ||
rm -rf $VCPKG_ROOT || true | ||
git clone https://github.com/Microsoft/vcpkg.git $VCPKG_ROOT | ||
$VCPKG_ROOT/bootstrap-vcpkg.sh | ||
$VCPKG_ROOT/vcpkg integrate install | ||
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV | ||
echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV | ||
# Verify vcpkg installation | ||
if [ ! -f "$VCPKG_ROOT/vcpkg" ]; then | ||
echo "Error: vcpkg executable not found" | ||
exit 1 | ||
fi | ||
- name: Install vcpkg dependencies | ||
run: | | ||
# Ensure VCPKG_ROOT is set | ||
if [ -z "$VCPKG_ROOT" ]; then | ||
echo "Error: VCPKG_ROOT is not set" | ||
exit 1 | ||
fi | ||
echo "Installing dependencies from vcpkg.json manifest..." | ||
$VCPKG_ROOT/vcpkg install \ | ||
boost-chrono:$VCPKG_DEFAULT_TRIPLET \ | ||
boost-filesystem:$VCPKG_DEFAULT_TRIPLET \ | ||
boost-system:$VCPKG_DEFAULT_TRIPLET \ | ||
boost-thread:$VCPKG_DEFAULT_TRIPLET \ | ||
boost-serialization:$VCPKG_DEFAULT_TRIPLET \ | ||
boost-test:$VCPKG_DEFAULT_TRIPLET \ | ||
tbb:$VCPKG_DEFAULT_TRIPLET | ||
echo "Verifying installations..." | ||
$VCPKG_ROOT/vcpkg list | ||
# Verify boost installation specifically | ||
for component in chrono filesystem system thread serialization test; do | ||
if ! $VCPKG_ROOT/vcpkg list | grep -q "boost-${component}"; then | ||
echo "Error: boost-${component} not found in installed packages" | ||
exit 1 | ||
fi | ||
done | ||
# Verify TBB installation | ||
if ! $VCPKG_ROOT/vcpkg list | grep -q "^tbb:"; then | ||
echo "Error: TBB not found in installed packages" | ||
exit 1 | ||
fi | ||
- name: Verify vcpkg setup | ||
run: | | ||
ls -la ${{github.workspace}}/vcpkg | ||
ls -la ${{github.workspace}}/vcpkg/installed || true | ||
vcpkg list | ||
echo "Using vcpkg triplet: ${{env.VCPKG_DEFAULT_TRIPLET}}" | ||
echo "VCPKG_ROOT location: ${{env.VCPKG_ROOT}}" | ||
- name: Create Build Dir | ||
run: cmake -E make_directory ${{github.workspace}}/build | ||
|
||
- name: Configure CMake | ||
working-directory: ${{github.workspace}}/build | ||
env: | ||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | ||
VCPKG_DEFAULT_TRIPLET: x64-linux | ||
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
run: | | ||
cmake ${{github.workspace}} \ | ||
-G Ninja \ | ||
-DCMAKE_TOOLCHAIN_FILE=${{env.CMAKE_TOOLCHAIN_FILE}} \ | ||
-DVCPKG_ROOT=${{env.VCPKG_ROOT}} \ | ||
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_DEFAULT_TRIPLET}} \ | ||
-DOPENMIND_BUILD_SAMPLES=OFF \ | ||
-DOPENMIND_BUILD_TESTS=ON \ | ||
-DOPENMIND_USE_OPENCL=OFF \ | ||
-DOPENMIND_USE_CUDA=OFF \ | ||
-DOPENMIND_USE_DPCPP=OFF | ||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
run: cmake --build . -j $(nproc) | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
run: ctest . -j $(nproc) -E "ts" --rerun-failed --output-on-failure |