Merge pull request #338 from Merc6/ci/cleanup-github-actions

Ci/cleanup GitHub actions
This commit is contained in:
Tropical 2026-03-29 20:53:33 -05:00 committed by GitHub
commit 7d7116b6ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 137 deletions

View file

@ -1,132 +1,38 @@
name: Build (Linux, x86_64)
name: Build (Linux, x86-64)
on:
push:
paths:
paths: &workflow_paths
- '**.cpp'
- '**.h'
- '**.c'
- '**/meson.build'
- 'meson.build'
- '**/CMakeLists.txt'
- 'CMakeLists.txt'
- '**.cc'
- '**.cxx'
- '**.hh'
- '**.hpp'
- '**.hxx'
- '**.inl'
- "**meson.build"
- "flake.nix"
- '.github/workflows/build-linux.yml'
pull_request:
paths:
- '**.cpp'
- '**.h'
- '**.c'
- '**/meson.build'
- 'meson.build'
- '**/CMakeLists.txt'
- 'CMakeLists.txt'
- '.github/workflows/build-linux.yml'
paths: *workflow_paths
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Install system dependencies
run: |
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
python -m pip install meson
# Set a reasonable ccache size
ccache -M 5G || true
- name: Restore ccache
uses: actions/cache@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('**/meson.build') }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Restore meson cache
uses: actions/cache@v4
with:
path: ~/.cache/meson
key: ${{ runner.os }}-meson-${{ hashFiles('**/meson.build') }}
- name: Build
run: nix build --print-build-logs
- name: Configure Meson
env:
CC: "ccache clang"
CXX: "ccache clang++"
CCACHE_DIR: ${{ runner.temp }}/ccache
run: |
mkdir -p "$CCACHE_DIR"
export CCACHE_DIR="$CCACHE_DIR"
meson setup build_release --wipe --buildtype=release --native-file=./scripts/llvm_native.txt
- 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_release -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-release_exe-${{ github.sha }}
path: build_release/Minecraft.Client/Minecraft.Client
retention-days: 7
build-linux-debug:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
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
python -m pip install meson
# Set a reasonable ccache size
ccache -M 5G || true
- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-debug-${{ hashFiles('**/meson.build') }}
- name: Restore meson cache
uses: actions/cache@v4
with:
path: ~/.cache/meson
key: ${{ runner.os }}-meson-debug-${{ hashFiles('**/meson.build') }}
- name: Configure Meson (debug)
env:
CC: "ccache clang"
CXX: "ccache clang++"
CCACHE_DIR: ${{ runner.temp }}/ccache
run: |
mkdir -p "$CCACHE_DIR"
export CCACHE_DIR="$CCACHE_DIR"
meson setup build_debug --wipe --buildtype=debug --native-file=./scripts/llvm_native.txt
- name: Build Debug 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_debug -j $(nproc) -v Minecraft.Client
- name: Upload debug executable
uses: actions/upload-artifact@v4
with:
name: minecraft-client-linux-debug_exe-${{ github.sha }}
path: build_debug/Minecraft.Client/Minecraft.Client
retention-days: 7
- name: Flake integrity
run: nix flake check

View file

@ -1,22 +1,8 @@
name: Clang Format
name: Format Check
on:
push:
paths:
- '**.cpp'
- '**.h'
- '**.c'
- '**.cc'
- '**.cxx'
- '**.hh'
- '**.hpp'
- '**.hxx'
- '**.inl'
- '.clang-format'
- '.github/workflows/clang-format.yml'
- '.github/scripts/check-clang-format.sh'
pull_request:
paths:
paths: &workflow_paths
- '**.cpp'
- '**.h'
- '**.c'
@ -30,26 +16,29 @@ on:
- '.github/workflows/clang-format.yml'
- '.github/scripts/check-clang-format.sh'
pull_request:
paths: *workflow_paths
jobs:
clang-format:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
concurrency:
group: clang-format-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-depth: 2
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-19
uses: daaku/gh-action-apt-install@v4
with:
packages: clang-format
- name: Check changed files
env:
CLANG_FORMAT_BIN: clang-format-19
CLANG_FORMAT_BIN: clang-format
EVENT_NAME: ${{ github.event_name }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}

View file

@ -54,6 +54,7 @@
version = "0.1.0";
src = ./.;
dontFixup = true;
dontUseCmakeConfigure = true;
# 4jcraft - Meson expects this subprojects structure
@ -100,6 +101,7 @@
openssl.dev
libGL
libGLU
glm
SDL2
zlib
];