diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3db3c51..ea10b13 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,41 +19,71 @@ jobs: steps: - uses: actions/checkout@v3 + + - name: Set up vpckg + run: | + git clone https://github.com/microsoft/vcpkg.git + .\vcpkg\bootstrap-vcpkg.bat + echo "VCPKG_ROOT=$(pwd)\\vcpkg" >> $env:GITHUB_ENV + + - name: Install vcpkg dependencies + run: | + $vcpkgPath = Join-Path $env:VCPKG_ROOT "vcpkg.exe" + & $vcpkgPath install + + - name: Cache vcpkg packages + uses: actions/cache@v4 + with: + path: vcpkg_installed + key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }} + restore-keys: | + ${{ runner.os }}-vcpkg- - 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 ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + run: | + cmake . ` + -B ${{github.workspace}}\\build ` + -D CMAKE_TOOLCHAIN_FILE=${{github.workspace}}\\CMake\\cache_entries.cmake ` + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}} + linux-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Upgrade packages + run: sudo apt-get update && sudo apt-get upgrade + + - name: Install dependencies + run: sudo apt-get install \ + clang-15 + + - name: Set up vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git + ./vcpkg/bootstrap-vcpkg.sh + echo "VCPKG_ROOT=$(pwd)/vcpkg" >> $GITHUB_ENV + + - name: Install vcpkg dependencies + run: | + ./vcpkg/vcpkg install + + - name: Cache vcpkg packages + uses: actions/cache@v3 + with: + path: vcpkg_installed + key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }} + restore-keys: | + ${{ runner.os }}-vcpkg- + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + env: + CC: clang-18 + CXX: clang-18 + - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -# linux-build: -# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. -# # You can convert this to a matrix build if you need cross-platform coverage. -# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# runs-on: ubuntu-latest -# -# steps: -# - uses: actions/checkout@v3 -# -# - name: Install dependencies -# run: sudo apt-get install xorg-dev -# -# - name: Upgrade packages -# run: sudo apt-get update && sudo apt-get upgrade -# -# - name: Get GCC12 -# run: sudo apt-get install gcc-12 g++-12 -# -# - 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 ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# env: -# CC: gcc-12 -# CXX: g++-12 -# -# - name: Build -# # Build your program with the given configuration -# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}