|
7 | 7 | - master |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build: |
11 | | - name: Build |
| 10 | + linux: |
| 11 | + name: Linux |
12 | 12 |
|
13 | | - runs-on: ${{ matrix.os }} |
14 | 13 | strategy: |
15 | 14 | fail-fast: false |
16 | 15 | matrix: |
17 | 16 | include: |
18 | | - - os: windows-latest |
19 | | - makefile: Makefile.msvc |
20 | | - - os: ubuntu-latest |
21 | | - makefile: Makefile |
| 17 | + - compiler: clang |
| 18 | + cxxcompiler: clang++ |
| 19 | + - compiler: gcc |
| 20 | + cxxcompiler: g++ |
| 21 | + |
| 22 | + runs-on: ubuntu-latest |
| 23 | + env: |
| 24 | + CC: ${{ matrix.compiler }} |
| 25 | + CXX: ${{ matrix.cxxcompiler }} |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout |
| 29 | + uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Install GCC problem matcher |
| 32 | + uses: ammaraskar/gcc-problem-matcher@master |
| 33 | + |
| 34 | + - name: Build |
| 35 | + run: | |
| 36 | + mkdir build |
| 37 | + cd build |
| 38 | +
|
| 39 | + echo "::group::CMake" |
| 40 | + cmake .. |
| 41 | + echo "::endgroup::" |
| 42 | +
|
| 43 | + echo "::group::Build" |
| 44 | + echo "Running on $(nproc) cores" |
| 45 | + cmake --build . -j $(nproc) |
| 46 | + echo "::endgroup::" |
| 47 | +
|
| 48 | + macos: |
| 49 | + name: Mac OS |
| 50 | + |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + include: |
| 55 | + - arch: arm64 |
| 56 | + full_arch: arm64 |
| 57 | + |
| 58 | + runs-on: macos-latest |
| 59 | + env: |
| 60 | + MACOSX_DEPLOYMENT_TARGET: 10.13 |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Install GCC problem matcher |
| 67 | + uses: ammaraskar/gcc-problem-matcher@master |
| 68 | + |
| 69 | + - name: Build |
| 70 | + run: | |
| 71 | + mkdir build |
| 72 | + cd build |
| 73 | +
|
| 74 | + echo "::group::CMake" |
| 75 | + cmake ${GITHUB_WORKSPACE} \ |
| 76 | + -DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \ |
| 77 | + # EOF |
| 78 | + echo "::endgroup::" |
| 79 | +
|
| 80 | + echo "::group::Build" |
| 81 | + echo "Running on $(sysctl -n hw.logicalcpu) cores" |
| 82 | + cmake --build . -j $(sysctl -n hw.logicalcpu) |
| 83 | + echo "::endgroup::" |
| 84 | +
|
| 85 | + windows: |
| 86 | + name: Windows |
| 87 | + |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + os: [windows-latest] |
| 92 | + arch: [x86, x64] |
| 93 | + |
| 94 | + runs-on: ${{ matrix.os }} |
22 | 95 |
|
23 | 96 | steps: |
24 | 97 | - name: Checkout |
25 | | - uses: actions/checkout@v1 |
26 | | - - name: Set build environment |
27 | | - if: matrix.os == 'windows-latest' |
| 98 | + uses: actions/checkout@v4 |
| 99 | + |
| 100 | + - name: Install MSVC problem matcher |
| 101 | + uses: ammaraskar/msvc-problem-matcher@master |
| 102 | + |
| 103 | + - name: Configure developer command prompt for ${{ matrix.arch }} |
28 | 104 | uses: ilammy/msvc-dev-cmd@v1 |
29 | 105 | with: |
30 | | - arch: x86 |
| 106 | + arch: ${{ matrix.arch }} |
| 107 | + |
31 | 108 | - name: Build |
32 | | - run: make -f ${{ matrix.makefile }} |
33 | 109 | shell: bash |
| 110 | + run: | |
| 111 | + mkdir build |
| 112 | + cd build |
| 113 | +
|
| 114 | + echo "::group::CMake" |
| 115 | + cmake .. \ |
| 116 | + -GNinja \ |
| 117 | + # EOF |
| 118 | + echo "::endgroup::" |
| 119 | +
|
| 120 | + echo "::group::Build" |
| 121 | + cmake --build . |
| 122 | + echo "::endgroup::" |
| 123 | +
|
| 124 | + check_annotations: |
| 125 | + name: Check Annotations |
| 126 | + needs: |
| 127 | + - linux |
| 128 | + - macos |
| 129 | + - windows |
| 130 | + |
| 131 | + if: always() && github.event_name == 'pull_request' |
| 132 | + |
| 133 | + runs-on: ubuntu-latest |
| 134 | + |
| 135 | + steps: |
| 136 | + - name: Check annotations |
| 137 | + uses: OpenTTD/actions/annotation-check@v5 |
0 commit comments