CI: fixing build #25
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
name: Vcpkg CI | |
on: [push] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
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 (Ubuntu) | |
if: runner.os == 'Linux' | |
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: Install dependencies (macOS) | |
if: runner.os == 'macOS' | |
env: | |
VCPKG_PYTHON3: $(which python3) | |
run: | | |
echo "VCPKG_PYTHON3=$VCPKG_PYTHON3" >> $GITHUB_ENV | |
brew update | |
brew install cmake ninja autoconf automake autoconf-archive | |
cmake --version | |
ninja --version | |
clang --version | |
- name: Install dependencies (Windows) | |
if: runner.os == 'Windows' | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup MSVC | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgGitCommitId: '3508985146f1b1d248c67ead13f8f54be5b4f5da' | |
vcpkgJsonGlob: '**/vcpkg.json' | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=NO | |
- name: Build prerequisites | |
run: > | |
cmake --build ${{ steps.strings.outputs.build-output-dir }} --target prerequisites | |
- name: Re-Configure CMake to detect built prerequisites | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
- name: Build | |
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} | |
- name: Get number of CPU cores | |
uses: SimenB/github-actions-cpu-cores@v2 | |
id: cpu-cores |