From 4b09a220410948458af5ae377aaaaefec6ffc43a Mon Sep 17 00:00:00 2001 From: SuperSonic16 <25761885+thesupersonic16@users.noreply.github.com> Date: Wed, 12 Feb 2025 01:04:15 +1100 Subject: [PATCH] Add Linux CI for Debugging (#366) * Attempt 0 * Attempt 1 * Attempt 2 * Attempt 3 * Removed push event * L --- .github/workflows/build-linux.yml | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/build-linux.yml diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000..7506f11 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,73 @@ +name: Build Project (Linux) + +on: + workflow_dispatch: + +env: + LLVM_VERSION: 18 + CMAKE_PRESET: linux-relwithdebinfo + +jobs: + build: + name: Build Linux + runs-on: ubuntu-24.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: recursive + token: ${{ secrets.ORG_TOKEN }} + + - name: Checkout Private Repository + uses: actions/checkout@v4 + with: + repository: ${{ secrets.ASSET_REPO }} + token: ${{ secrets.ASSET_REPO_TOKEN }} + path: ./private + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ccache-${{ runner.os }} + + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: | + ./thirdparty/vcpkg/downloads + ./thirdparty/vcpkg/packages + key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }} + restore-keys: | + vcpkg-${{ runner.os }}- + + - name: Install Dependencies + run: |- + sudo apt update + sudo apt install -y ninja-build llvm-${{ env.LLVM_VERSION }}-dev libgtk-3-dev + + - name: Cache ccache Directory + uses: actions/cache@v4 + with: + path: /tmp/ccache + key: ccache-${{ runner.os }} + + - name: Prepare Project + run: cp ./private/* ./UnleashedRecompLib/private + + - name: Configure Project + env: + CCACHE_DIR: /tmp/ccache + run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache + + - name: Build Project + env: + CCACHE_DIR: /tmp/ccache + run: cmake --build ./out/build/${{ env.CMAKE_PRESET }} --target UnleashedRecomp + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: UnleashedRecomp-Linux + path: ./out/build/${{ env.CMAKE_PRESET }}/UnleashedRecomp/UnleashedRecomp + \ No newline at end of file