From 7ec6f5b27748a5e8260d51a479de430ba6528f0b Mon Sep 17 00:00:00 2001 From: acidicoala <67734819+acidicoala@users.noreply.github.com> Date: Sat, 4 Oct 2025 20:50:03 +0500 Subject: [PATCH] Fix Build CI --- .github/workflows/build.yml | 2 +- .github/workflows/kb/build.yml | 128 +++++++++++++++++++++++++++++++++ KoalaBox | 2 +- 3 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/kb/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db9e56d..08ca16f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push jobs: build: name: 🏗️ Build - uses: acidicoala/KoalaBox/.github/workflows/build.yml@90b2994bbb27ae415b04d99c287fcafb5b648354 + uses: .github/workflows/kb/build.yml@master with: #language=json module: '[ "SmokeAPI" ] ' diff --git a/.github/workflows/kb/build.yml b/.github/workflows/kb/build.yml new file mode 100644 index 0000000..106a11b --- /dev/null +++ b/.github/workflows/kb/build.yml @@ -0,0 +1,128 @@ +name: 🏗️ Build +on: + workflow_call: + inputs: + module: + description: 'Stringified JSON array of CMake projects to build' + required: true + type: string + + os: + description: 'Stringified JSON array of target operating systems. Can be "Windows", "Linux", or both.' + required: true + type: string + + bitness: + description: 'Stringified JSON array of target bitness. Can be 32, 64, or both.' + required: true + type: string + +jobs: + build: + name: ${{ matrix.module }}-${{ matrix.os }}-${{ matrix.bitness }} + runs-on: ${{ matrix.runner }} + strategy: + matrix: + module: ${{ fromJson(inputs.module) }} + os: ${{ fromJson(inputs.os) }} + bitness: ${{ fromJson(inputs.bitness) }} + + include: + # Runner + - os: Windows + runner: windows-2025 + + - os: Linux + runner: ubuntu-24.04 + + # Compiler + - os: Linux + compiler: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + + # Architecture flags + - os: Windows + bitness: 32 + arch: -A Win32 + + - os: Windows + bitness: 64 + arch: -A x64 + + - os: Linux + bitness: 32 + arch: -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS="-m32 -L/usr/lib/i386-linux-gnu" -DCMAKE_PREFIX_PATH=/usr/lib/i386-linux-gnu + + - os: Linux + bitness: 64 + arch: -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_FLAGS=-m64 -DCMAKE_EXE_LINKER_FLAGS=-m64 + + # Output paths + - os: Windows + output: 'Release/*.dll' + + - os: Linux + output: '*.so' + + env: + BUILD_DIR: ${{ github.workspace }}/build + + steps: + - name: '🛠️ Install dependencies' + if: ${{ matrix.os == 'Linux' }} + run: | + if [ "${{ matrix.bitness }}" = "32" ]; then + sudo dpkg --add-architecture i386 + deps="libbrotli-dev:i386 libzstd-dev:i386 libssl-dev:i386 gcc-multilib g++-multilib" + else + deps="libbrotli-dev libzstd-dev" + fi + deps="$deps libgtk-3-dev gcc" + + sudo apt update + sudo rm /var/lib/man-db/auto-update + sudo apt install $deps + + - name: '🛠️ Install LLVM and Clang' + if: ${{ matrix.os == 'Linux' }} + uses: KyleMayes/install-llvm-action@v2 + with: + version: "20.0" + + - name: '🛠️ Check Clang version' + if: ${{ matrix.os == 'Linux' }} + run: clang++ --version + + - name: '📥 Check out repository code' + uses: actions/checkout@v5 + with: + submodules: recursive + + - name: '🗃️ Cache CPM dependencies' + uses: actions/cache@v4 + with: + key: ${{ matrix.os }}-${{ matrix.bitness }} + path: '${{ env.BUILD_DIR }}/.cache' + + - name: '⚙️ Generate build files' + # Note: indenting arguments will lead to parsing errors + run: > + cmake + -B "${{ env.BUILD_DIR }}" + -DCMAKE_BUILD_TYPE=Release + -DMODULE=${{ matrix.module }} + ${{ matrix.arch }} + ${{ matrix.compiler }} + --debug-output + + - name: Build the project + run: > + cmake + --build ${{ env.BUILD_DIR }} + --config Release + --target ${{ matrix.module }} + + - name: Upload binaries + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.module }}-${{ matrix.os }}-${{ matrix.arch }} + path: ${{ env.BUILD_DIR }}/${{ matrix.output }} diff --git a/KoalaBox b/KoalaBox index 90b2994..df1600e 160000 --- a/KoalaBox +++ b/KoalaBox @@ -1 +1 @@ -Subproject commit 90b2994bbb27ae415b04d99c287fcafb5b648354 +Subproject commit df1600efb7109be80e8f786e42e7945ac2c31af2