Merge pull request #366 from TheComputerGuy96/fix/ci-meson

CI improvements
This commit is contained in:
Tropical 2026-03-30 10:57:32 -05:00 committed by GitHub
commit bedd46fcec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 22 deletions

View file

@ -9,6 +9,8 @@ on:
- "Minecraft.World/**"
- "docs/**"
workflow_dispatch:
jobs:
build:
permissions:

View file

@ -19,6 +19,8 @@ on:
pull_request:
paths: *workflow_paths
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
@ -32,48 +34,33 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential ccache python3 python3-pip ninja-build libsdl2-dev libgl-dev libglu1-mesa-dev libpthread-stubs0-dev libglm-dev
python -m pip install meson
# Set a reasonable ccache size
ccache -M 5G || true
python -m pip install meson
- name: Restore ccache
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ~/.ccache
path: ${{ runner.temp }}/ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }}
- name: Restore meson cache
uses: actions/cache@v4
with:
path: ~/.cache/meson
key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }}
restore-keys: ${{ runner.os }}-ccache-
- name: Configure Meson
env:
CC: "ccache clang"
CXX: "ccache clang++"
CCACHE_DIR: ${{ runner.temp }}/ccache
CC_LD: lld
CXX_LD: lld
run: |
mkdir -p "$CCACHE_DIR"
export CCACHE_DIR="$CCACHE_DIR"
meson setup build --wipe --native-file=./scripts/llvm_native.txt
meson setup build --wipe
- name: Build with Meson
env:
CC: "ccache clang"
CXX: "ccache clang++"
CCACHE_DIR: ${{ runner.temp }}/ccache
run: |
export CCACHE_DIR="${{ runner.temp }}/ccache"
# Use all available cores for faster parallel builds
meson compile -C build -j $(nproc) -v Minecraft.Client
- name: Install patchelf
run: sudo apt-get install -y patchelf
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: minecraft-client-linux-${{ github.sha }}
path: build/Minecraft.Client/Minecraft.Client
retention-days: 7
retention-days: 7

View file

@ -19,6 +19,8 @@ on:
pull_request:
paths: *workflow_paths
workflow_dispatch:
jobs:
clang-format:
runs-on: ubuntu-latest