diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml new file mode 100644 index 0000000..3747ed8 --- /dev/null +++ b/.github/workflows/linux_build.yml @@ -0,0 +1,97 @@ +name: 🐧 Linux Builds + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + build-linux: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout Source Code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Clang Compiler + uses: egor-tensin/setup-clang@v1 + with: + version: 20 + + - name: Install System Dependencies + run: | + wget https://github.com/Kitware/CMake/releases/download/v4.3.0/cmake-4.3.0-linux-x86_64.tar.gz + tar -xzf cmake-4.3.0-linux-x86_64.tar.gz + echo "$(pwd)/cmake-4.3.0-linux-x86_64/bin" >> $GITHUB_PATH + + sudo apt-get update + sudo apt-get install -y \ + ninja-build \ + ccache \ + llvm-20 \ + llvm-20-tools \ + clang-tools-20 \ + libc++-20-dev \ + libc++abi-20-dev \ + libgl1-mesa-dev \ + libegl1-mesa-dev \ + libwayland-egl1-mesa \ + libasound2-dev \ + libpulse-dev \ + libwayland-dev \ + libx11-dev \ + libxext-dev \ + libxrender-dev \ + libxrandr-dev \ + libxinerama-dev \ + libxcursor-dev \ + libxi-dev \ + libxtst-dev + echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH + + - name: Verify LLVM Toolchain + run: | + which clang + which clang++ + which clang-scan-deps + clang --version + clang++ --version + clang-scan-deps --version + + - name: Cache Build Artifacts + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + restore-keys: | + ${{ runner.os }}-ccache- + max-size: "500M" + + - name: Configure Build System + run: | + cmake --preset debug \ + -B build/debug \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \ + -DCMAKE_INSTALL_RPATH="\$ORIGIN:\$ORIGIN/engine/native" + + - name: Compile Target Binary + run: | + cmake --build build/debug -j$(nproc) + + - name: Run Unit Tests + run: | + ctest --test-dir build/debug --output-on-failure -j$(nproc) + + - name: Upload Engine Artifact + uses: actions/upload-artifact@v4 + with: + name: linux_debug + path: build/debug/ + if-no-files-found: error + retention-days: 7 \ No newline at end of file