From 932064ffeec50dbfab1f347ef2d144b6558e1f81 Mon Sep 17 00:00:00 2001
From: Jarod42 <Jarod42@users.noreply.github.com>
Date: Mon, 11 Mar 2024 15:46:30 +0100
Subject: [PATCH] [CI] Add github action for macos

---
 .github/workflows/macos.yml | 50 +++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 .github/workflows/macos.yml

diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
new file mode 100644
index 0000000000..7a3c612621
--- /dev/null
+++ b/.github/workflows/macos.yml
@@ -0,0 +1,50 @@
+name: macos
+
+on:
+  workflow_dispatch:
+  push:
+  pull_request:
+
+jobs:
+  macos:
+    runs-on: macos-latest
+
+    steps:
+
+    - name: Install Codelite's dependencies
+      run: |
+        # brew update && brew upgrade # fails somehow
+        brew install git cmake libssh hunspell
+
+    # WxWidgets
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+          repository: wxWidgets/wxWidgets
+          path: wxWidgets
+          submodules: recursive
+    
+    - name: Build and install wxWidgets
+      run: |
+        mkdir wxWidgets/build-release
+        cd wxWidgets/build-release
+        ../configure --enable-shared --enable-monolithic --with-osx_cocoa CXX='clang++ -std=c++11 -stdlib=libc++ -I../src/tiff/libtiff' CC=clang --disable-debug --disable-mediactrl --enable-stl
+        make -j10
+        sudo make install
+
+    # Codelite
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        submodules: recursive
+
+    - name: Build and install Codelite
+      run: |
+        mkdir build-release
+        cd build-release
+        cmake .. -DCMAKE_BUILD_TYPE=Release
+        cmake --build . -j $(sysctl -n hw.physicalcpu)
+        cmake --build . --target install
+
+    - name: codelite --version
+      run: codelite.app/Contents/MacOS/codelite --version || exit 0 # codelite --version returns -1