Merge pull request #17 from bbalouki/bbs-dev #12
This file contains hidden or 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: macOS | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-test: | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build_type: [Release, Debug] | |
| cpp_standard: [20, 23] | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| BUILD_DIR: ${{ github.workspace }}/build | |
| CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| - name: Cache vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.VCPKG_ROOT }} | |
| ~/.cache/vcpkg | |
| key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-vcpkg- | |
| - name: Set up vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| - name: Cache CMake build | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.BUILD_DIR }} | |
| key: ${{ runner.os }}-${{ matrix.build_type }}-cmake-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.build_type }}-cmake- | |
| - name: Configure CMake | |
| shell: bash | |
| run: | | |
| cmake -S . -B $BUILD_DIR \ | |
| -DITCH_PROJECT_ENV=PROD \ | |
| -DITCH_BUILD_TESTS=ON \ | |
| -DITCH_CXX_STANDARD=${{ matrix.cpp_standard }} \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \ | |
| -DVCPKG_TARGET_TRIPLET=$(if [[ "$(uname -m)" == "arm64" ]]; then echo "arm64-osx"; else echo "x64-osx"; fi) | |
| - name: Build | |
| shell: bash | |
| run: cmake --build $BUILD_DIR --config ${{ matrix.build_type }} | |
| - name: Run tests | |
| shell: bash | |
| run: ctest --test-dir $BUILD_DIR --output-on-failure --build-config ${{ matrix.build_type }} |