aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/macos-arm-build.yml
blob: b6497abc81a3e63b9b32c4cc0c56d77148c52ca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: macOS arm64

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: macos-14

    steps:
    - uses: actions/checkout@v4

    - name: Set reusable strings
      id: strings
      shell: bash
      run: |
        echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

    - name: Install/Update requirements
      env:
        HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
      run: |
        brew update
        brew uninstall openssl@1.1
        brew install mysql openssl readline cmake boost coreutils ninja
        brew config

    - name: Check some deps
      run: |
        mysql --version
        openssl version
        
    - name: Print CPU info
      run: |
         echo "Cores: $(nproc), Arch: $(uname -p)"
        
    - name: Configure CMake
      env:
        CMAKE_BUILD_TYPE: Debug
      run: >
        cmake -GNinja -B ${{ steps.strings.outputs.build-output-dir }}
        -DWITH_WARNINGS=1 -DWITH_WARNINGS_AS_ERRORS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=static -DSERVERS=1 -DBUILD_TESTING=1
        -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG"
        -DCMAKE_INSTALL_PREFIX=check_install
        -S ${{ github.workspace }}

    - name: Build
      run: |
        cd ${{ steps.strings.outputs.build-output-dir }}
        ninja
        ninja install
      
    - name: Unit tests
      run: |
        cd ${{ steps.strings.outputs.build-output-dir }}
        ninja test
      
    - name: Check binaries
      run: |
        cd ${{ github.workspace }}/check_install/bin
        ./bnetserver --version
        ./worldserver --version