From 9e9811fe995034f27ebfae80058acc39b9204cfa Mon Sep 17 00:00:00 2001 From: Liangliang Nan Date: Mon, 13 Jan 2025 20:13:19 +0100 Subject: [PATCH] Update test-build.yml --- .github/workflows/test-build.yml | 40 ++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 7902b5e..dd7e2e5 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -28,8 +28,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update || true - sudo apt-get install -y build-essential libglu1-mesa-dev \ - mesa-common-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libboost-all-dev + sudo apt-get install -y build-essential libboost-all-dev mkdir -p build && cd build cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. make @@ -44,13 +43,34 @@ jobs: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. make - # Set up environment and build on Windows - - name: Build on Windows + # Set up Conda on Windows + - name: Set up Conda (Windows) if: runner.os == 'Windows' - shell: cmd + uses: conda-incubator/setup-miniconda@v3 + with: + architecture: x64 + activate-environment: AdTreeEnv + auto-activate-base: false + channels: conda-forge,defaults + + # Install Boost via Conda on Windows + - name: Install Dependencies (Windows) + if: runner.os == 'Windows' + shell: bash -l {0} + run: conda install -y boost + + # Configure CMake on Windows + - name: Configure (Windows) + if: runner.os == 'Windows' + shell: bash -l {0} run: | - choco install boost cmake --installargs '"ADD_CMAKE_TO_PATH=System"' - mkdir build - cd build - cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. - cmake --build . --config ${{ matrix.build_type }} + cmake -S . -B build/${{ matrix.build_type }} \ + -G "Visual Studio 17 2022" \ + -A x64 \ + -DBOOST_ROOT="$CONDA_PREFIX/Library" + + # Build on Windows + - name: Build (Windows) + if: runner.os == 'Windows' + shell: bash -l {0} + run: cmake --build build/${{ matrix.build_type }} --config ${{ matrix.build_type }}