Change: Switch to CMake. #10
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| linux: | |
| name: Linux | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - compiler: clang | |
| cxxcompiler: clang++ | |
| - compiler: gcc | |
| cxxcompiler: g++ | |
| runs-on: ubuntu-latest | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| CXX: ${{ matrix.cxxcompiler }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install GCC problem matcher | |
| uses: ammaraskar/gcc-problem-matcher@master | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| echo "::group::CMake" | |
| cmake .. | |
| echo "::endgroup::" | |
| echo "::group::Build" | |
| echo "Running on $(nproc) cores" | |
| cmake --build . -j $(nproc) | |
| echo "::endgroup::" | |
| macos: | |
| name: Mac OS | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: arm64 | |
| full_arch: arm64 | |
| runs-on: macos-latest | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 10.13 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install GCC problem matcher | |
| uses: ammaraskar/gcc-problem-matcher@master | |
| - name: Build | |
| run: | | |
| mkdir build | |
| cd build | |
| echo "::group::CMake" | |
| cmake ${GITHUB_WORKSPACE} \ | |
| -DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \ | |
| # EOF | |
| echo "::endgroup::" | |
| echo "::group::Build" | |
| echo "Running on $(sysctl -n hw.logicalcpu) cores" | |
| cmake --build . -j $(sysctl -n hw.logicalcpu) | |
| echo "::endgroup::" | |
| windows: | |
| name: Windows | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest] | |
| arch: [x86, x64] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install MSVC problem matcher | |
| uses: ammaraskar/msvc-problem-matcher@master | |
| - name: Configure developer command prompt for ${{ matrix.arch }} | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| - name: Build | |
| shell: bash | |
| run: | | |
| mkdir build | |
| cd build | |
| echo "::group::CMake" | |
| cmake .. \ | |
| -GNinja \ | |
| # EOF | |
| echo "::endgroup::" | |
| echo "::group::Build" | |
| cmake --build . | |
| echo "::endgroup::" | |
| check_annotations: | |
| name: Check Annotations | |
| needs: | |
| - linux | |
| - macos | |
| - windows | |
| if: always() && github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check annotations | |
| uses: OpenTTD/actions/annotation-check@v5 |