From 3fc458c4bdfc5eac6f5475fb4e4490ca1c778a08 Mon Sep 17 00:00:00 2001 From: orng Date: Sat, 28 Mar 2026 22:50:30 -0500 Subject: [PATCH 01/20] ci: make `build-linux` use `flake.nix` --- .github/workflows/build-linux.yml | 132 +++--------------------------- 1 file changed, 13 insertions(+), 119 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 7d73c103d..acec27a69 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -1,132 +1,26 @@ -name: Build (Linux, x86_64) +name: Build (Linux x86/64) on: push: - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**/meson.build' - - 'meson.build' - - '**/CMakeLists.txt' - - 'CMakeLists.txt' - - '.github/workflows/build-linux.yml' - pull_request: - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**/meson.build' - - 'meson.build' - - '**/CMakeLists.txt' - - 'CMakeLists.txt' - - '.github/workflows/build-linux.yml' + - "**.cpp" + - "**.h" + - "**.meson.build" + - ".github/workflows/*" jobs: build-linux: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - - 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 - - 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 From 3a736777fd168a15e1eb89363818205fa72a6a77 Mon Sep 17 00:00:00 2001 From: orng Date: Sat, 28 Mar 2026 22:50:45 -0500 Subject: [PATCH 02/20] ci: simplify `clang-format` --- .github/workflows/clang-format.yml | 72 ++++++------------------------ 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 4965d4b15..ed5f9a402 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,69 +1,23 @@ -name: Clang Format +name: Clang-Format (Linux x86/64) 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: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - '.clang-format' - - '.github/workflows/clang-format.yml' - - '.github/scripts/check-clang-format.sh' + - "**.cpp" + - "**.h" + - "**.meson.build" + - ".github/workflows/*" jobs: - clang-format: - runs-on: ubuntu-24.04 - concurrency: - group: clang-format-${{ github.ref }} - cancel-in-progress: true + formatting-check: + runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install clang-format - run: | - sudo apt-get update - sudo apt-get install -y clang-format-19 - - - name: Check changed files - env: - CLANG_FORMAT_BIN: clang-format-19 - EVENT_NAME: ${{ github.event_name }} - PR_BASE_REF: ${{ github.event.pull_request.base.ref }} - PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} - BEFORE_SHA: ${{ github.event.before }} - CURRENT_SHA: ${{ github.sha }} - run: | - set -euo pipefail - - BASE_SHA="" - if [ "$EVENT_NAME" = "pull_request" ]; then - git fetch --no-tags origin "$PR_BASE_REF" - BASE_SHA="$(git merge-base "origin/$PR_BASE_REF" "$CURRENT_SHA")" - elif [ -n "$BEFORE_SHA" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then - BASE_SHA="$BEFORE_SHA" - fi - - bash ./.github/scripts/check-clang-format.sh "$BASE_SHA" "$CURRENT_SHA" + - name: Run clang-format style check + uses: jidicula/clang-format-action@v4.18.0 + with: + # keep this in line with the flake + clang-format-version: "21" From 09f3a33eddf82beacbb981eb46a5ba987d66a252 Mon Sep 17 00:00:00 2001 From: orng Date: Sat, 28 Mar 2026 22:59:03 -0500 Subject: [PATCH 03/20] test: push dummy file --- Minecraft.Client/really_good_cpp.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Minecraft.Client/really_good_cpp.cpp diff --git a/Minecraft.Client/really_good_cpp.cpp b/Minecraft.Client/really_good_cpp.cpp new file mode 100644 index 000000000..d4244cd5b --- /dev/null +++ b/Minecraft.Client/really_good_cpp.cpp @@ -0,0 +1,15 @@ +// This is literally the best c++ code ever. I hope everyone reading this has a fantastic day. + +struct Foo { + Bar bar, baz, + + Foo() noexcept : bar(),baz() { delete Foo; } + + void qux() const { + print("Hello, world!") + } + + private: + + bool bob() { hi }; +}; From a954f3f61699184390c23365cbf58c6f492848a2 Mon Sep 17 00:00:00 2001 From: orng Date: Sat, 28 Mar 2026 23:01:06 -0500 Subject: [PATCH 04/20] chore: remove dummy file --- Minecraft.Client/really_good_cpp.cpp | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Minecraft.Client/really_good_cpp.cpp diff --git a/Minecraft.Client/really_good_cpp.cpp b/Minecraft.Client/really_good_cpp.cpp deleted file mode 100644 index d4244cd5b..000000000 --- a/Minecraft.Client/really_good_cpp.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// This is literally the best c++ code ever. I hope everyone reading this has a fantastic day. - -struct Foo { - Bar bar, baz, - - Foo() noexcept : bar(),baz() { delete Foo; } - - void qux() const { - print("Hello, world!") - } - - private: - - bool bob() { hi }; -}; From ceea5c356c696f27c13070fbba053d029200ddad Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:09:50 -0500 Subject: [PATCH 05/20] guh 1 --- .github/workflows/build-linux.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index acec27a69..83a05bb33 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -1,11 +1,12 @@ -name: Build (Linux x86/64) +name: Build (Linux, x86-64) on: push: - "**.cpp" - "**.h" - "**.meson.build" - - ".github/workflows/*" + - '.github/workflows/build-linux.yml' + jobs: build-linux: From d669174ecdd22de1627844178d0bcbb1fefac98a Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:11:32 -0500 Subject: [PATCH 06/20] guh 2 --- .github/workflows/build-linux.yml | 11 ++++++----- .github/workflows/clang-format.yml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 83a05bb33..14697e934 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -2,10 +2,11 @@ name: Build (Linux, x86-64) on: push: - - "**.cpp" - - "**.h" - - "**.meson.build" - - '.github/workflows/build-linux.yml' + paths: + - "**.cpp" + - "**.h" + - "**.meson.build" + - '.github/workflows/*' jobs: @@ -13,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Nix uses: cachix/install-nix-action@v31 diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index ed5f9a402..befc1e792 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,11 +1,12 @@ -name: Clang-Format (Linux x86/64) +name: Clang-Format (Linux, x86-64) on: push: - - "**.cpp" - - "**.h" - - "**.meson.build" - - ".github/workflows/*" + paths: + - "**.cpp" + - "**.h" + - "**.meson.build" + - ".github/workflows/*" jobs: formatting-check: From 80ca9142ef9081584a7a8a591c9cfc9da7131338 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:14:35 -0500 Subject: [PATCH 07/20] guh 3 --- .github/workflows/build-linux.yml | 19 +++++++++++++------ .github/workflows/clang-format.yml | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 14697e934..5729f6e2e 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -3,10 +3,17 @@ name: Build (Linux, x86-64) on: push: paths: - - "**.cpp" - - "**.h" + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' - "**.meson.build" - - '.github/workflows/*' + - '.github/workflows/build-linux.yml*' jobs: @@ -21,8 +28,8 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable - - name: Build - run: nix build - - name: Flake integrity run: nix flake check + + - name: Build + run: nix build diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index befc1e792..d51d1ee74 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,12 +1,20 @@ -name: Clang-Format (Linux, x86-64) +name: Check Format (Linux, x86-64) on: push: paths: - - "**.cpp" - - "**.h" - - "**.meson.build" - - ".github/workflows/*" + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' + - '.clang-format' + - '.github/workflows/clang-format.yml' + - '.github/scripts/check-clang-format.sh' jobs: formatting-check: From 23452bf1292888dd72791949018bfe4e39497985 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:15:53 -0500 Subject: [PATCH 08/20] guh 4 --- .github/workflows/build-linux.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 5729f6e2e..2fb11be51 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -14,7 +14,19 @@ on: - '**.inl' - "**.meson.build" - '.github/workflows/build-linux.yml*' - + pull_request: + paths: + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' + - "**.meson.build" + - '.github/workflows/build-linux.yml*' jobs: build-linux: From ec2a2b8d1362470e1a19132582ee605feaffa5cd Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:16:51 -0500 Subject: [PATCH 09/20] guhhhhhh --- .github/workflows/clang-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index d51d1ee74..01da33f84 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 From a66a391225e0e209cb9ffa122a808c82cbc4460d Mon Sep 17 00:00:00 2001 From: orng Date: Sun, 29 Mar 2026 19:45:20 -0500 Subject: [PATCH 10/20] fix: `flake.nix` should include glm --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index fd8af4473..2db0000d7 100644 --- a/flake.nix +++ b/flake.nix @@ -100,6 +100,7 @@ openssl.dev libGL libGLU + glm SDL2 zlib ]; From 715f5e1dae3ba2df780c645fd870f280ec8d8b8e Mon Sep 17 00:00:00 2001 From: orng Date: Sun, 29 Mar 2026 19:50:20 -0500 Subject: [PATCH 11/20] fix: `clang-format` should have an `on: pull_request` --- .github/workflows/clang-format.yml | 37 ++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 01da33f84..4908ef1f9 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -3,18 +3,31 @@ name: Check Format (Linux, x86-64) 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' + - "**.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: + - "**.cpp" + - "**.h" + - "**.c" + - "**.cc" + - "**.cxx" + - "**.hh" + - "**.hpp" + - "**.hxx" + - "**.inl" + - "**.meson.build" + - ".github/workflows/clang-format.yml*" jobs: formatting-check: From aafc823c75cdc3bbaffa48b30417748dc28b293f Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:52:44 -0500 Subject: [PATCH 12/20] fix: --print-build-logs --- .github/workflows/build-linux.yml | 47 +++++++++++------------------- .github/workflows/clang-format.yml | 29 +++++++++--------- 2 files changed, 31 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 2fb11be51..11e6eed3b 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -1,32 +1,19 @@ name: Build (Linux, x86-64) -on: - push: - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - "**.meson.build" - - '.github/workflows/build-linux.yml*' - pull_request: - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - "**.meson.build" - - '.github/workflows/build-linux.yml*' +on: [push, pull_request] + paths: + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' + - "**meson.build" + - "flake.nix" + - '.github/workflows/build-linux.yml' jobs: build-linux: @@ -40,8 +27,8 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable + - name: Build + run: nix build --print-build-logs + - name: Flake integrity run: nix flake check - - - name: Build - run: nix build diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 01da33f84..6aab5fd76 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,20 +1,19 @@ name: Check Format (Linux, x86-64) -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' +on: [push, pull_request] + paths: + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' + - "**meson.build" + - "flake.nix" + - '.github/workflows/build-linux.yml' jobs: formatting-check: From 43908b1de581668f52b289af9d7cf45a20b6451b Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:54:51 -0500 Subject: [PATCH 13/20] Update clang-format.yml --- .github/workflows/clang-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 4a01c2676..c099cd110 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,4 +1,4 @@ -name: Check Format (Linux, x86-64) +name: Format Check (Linux, x86-64) on: [push, pull_request] paths: From 39ebddbafcac7182de58dedeebff8cc1727b2fac Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:04:19 -0500 Subject: [PATCH 14/20] update format workflow --- .github/workflows/clang-format.yml | 49 +++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index c099cd110..2bf8ec762 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,4 +1,4 @@ -name: Format Check (Linux, x86-64) +name: Format on: [push, pull_request] paths: @@ -11,23 +11,42 @@ on: [push, pull_request] - '**.hpp' - '**.hxx' - '**.inl' - - "**meson.build" - - "flake.nix" - - ".clang-format" - - '.github/workflows/build-linux.yml' - - ".github/scripts/check-clang-format.sh" + - '.clang-format' + - '.github/workflows/clang-format.yml' + - '.github/scripts/check-clang-format.sh' jobs: - formatting-check: + clang-format: runs-on: ubuntu-latest + concurrency: + group: clang-format-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 0 + uses: actions/checkout@v4 - - name: Run clang-format style check - uses: jidicula/clang-format-action@v4.18.0 - with: - # keep this in line with the flake - clang-format-version: "21" + - name: Install clang-format + run: | + sudo apt-get update + sudo apt-get install -y clang-format-21 + + - name: Check changed files + env: + 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 }} + BEFORE_SHA: ${{ github.event.before }} + CURRENT_SHA: ${{ github.sha }} + run: | + set -euo pipefail + + BASE_SHA="" + if [ "$EVENT_NAME" = "pull_request" ]; then + git fetch --no-tags origin "$PR_BASE_REF" + BASE_SHA="$(git merge-base "origin/$PR_BASE_REF" "$CURRENT_SHA")" + elif [ -n "$BEFORE_SHA" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then + BASE_SHA="$BEFORE_SHA" + fi + + bash ./.github/scripts/check-clang-format.sh "$BASE_SHA" "$CURRENT_SHA" From 327addddaefb3d928f62f1eab379bb04be9332b3 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:06:38 -0500 Subject: [PATCH 15/20] yaml and its consequences for the human race --- .github/workflows/build-linux.yml | 32 +++++++++++++++++------------- .github/workflows/clang-format.yml | 32 +++++++++++++++++------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 11e6eed3b..e1ff0b0fd 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -1,19 +1,23 @@ name: Build (Linux, x86-64) -on: [push, pull_request] - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - "**meson.build" - - "flake.nix" - - '.github/workflows/build-linux.yml' +on: + push: + paths: &workflow_paths + - '**.cpp' + - '**.h' + - '**.c' + - '**.cc' + - '**.cxx' + - '**.hh' + - '**.hpp' + - '**.hxx' + - '**.inl' + - "**meson.build" + - "flake.nix" + - '.github/workflows/build-linux.yml' + + pull_request: + paths: *workflow_paths jobs: build-linux: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 2bf8ec762..9a4b43905 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,19 +1,23 @@ name: Format -on: [push, pull_request] - paths: - - '**.cpp' - - '**.h' - - '**.c' - - '**.cc' - - '**.cxx' - - '**.hh' - - '**.hpp' - - '**.hxx' - - '**.inl' - - '.clang-format' - - '.github/workflows/clang-format.yml' - - '.github/scripts/check-clang-format.sh' +on: + push: + paths: &workflow_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: *workflow_paths jobs: clang-format: From dcebd64557b96a9080432d882e36d7f5d1f2a374 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:07:16 -0500 Subject: [PATCH 16/20] rename to format check --- .github/workflows/clang-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 9a4b43905..7626686b9 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,4 +1,4 @@ -name: Format +name: Format Check on: push: From 6010fa184801118c4fa54816fdd27d651b274af2 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:35:03 -0500 Subject: [PATCH 17/20] test --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 2db0000d7..05ceb4fef 100644 --- a/flake.nix +++ b/flake.nix @@ -54,6 +54,7 @@ version = "0.1.0"; src = ./.; + dontFixup = true; dontUseCmakeConfigure = true; # 4jcraft - Meson expects this subprojects structure From 0e9c1403bff1530200b89a58734a643c2ed9ad54 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:36:42 -0500 Subject: [PATCH 18/20] hate you ubuntu --- .github/workflows/clang-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 7626686b9..e1bdc4b84 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -32,7 +32,7 @@ jobs: - name: Install clang-format run: | sudo apt-get update - sudo apt-get install -y clang-format-21 + sudo apt-get install -y clang-format - name: Check changed files env: From 7b5c2dfe257cd6dffc3a115fcbed0982c3826c09 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:43:14 -0500 Subject: [PATCH 19/20] use fetch-depth 0 for format workflow --- .github/workflows/clang-format.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index e1bdc4b84..297144427 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -27,7 +27,9 @@ jobs: cancel-in-progress: true steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 + with: + fetch-depth: 0 - name: Install clang-format run: | From 9d40fceecec0a736fab34fa7b06898f8b4d4d73e Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 29 Mar 2026 20:51:08 -0500 Subject: [PATCH 20/20] cache clang-format installation --- .github/workflows/clang-format.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 297144427..84820ad88 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -29,12 +29,12 @@ jobs: - name: Checkout repository 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 + uses: daaku/gh-action-apt-install@v4 + with: + packages: clang-format - name: Check changed files env: