From 1ec5c463619e396462327737583473faa5ed6747 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 18 Aug 2021 19:46:31 +0200 Subject: [PATCH] Try specifying clang-format exe path to spotless --- .github/workflows/format-check.yml | 17 ++++++++++++++++- formatters/build.gradle | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 551fb17aa..3da2e4366 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -13,6 +13,20 @@ jobs: sudo apt update sudo apt install -y --force-yes curl xz-utils libicu-dev git + - name: Cache Clang + id: cache-clang + uses: actions/cache@v2 + with: + path: clang + key: ${{ runner.os }}-clang + + - name: Install Clang + if: steps.cache-clang.outputs.cache-hit != 'true' + run: | + curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz --output clang.tar.xz + tar -xf clang.tar.xz + mv clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu- clang + - name: Install dotnet uses: actions/setup-dotnet@v1 with: @@ -35,7 +49,8 @@ jobs: java-version: "16" - name: Format - run: | + run: | + export CLANGFORMAT=`pwd`/clang/bin/clang-format export PATH="$PATH:/root/.dotnet/tools" ./formatters/format.sh diff --git a/formatters/build.gradle b/formatters/build.gradle index d9579f3b8..e73158bde 100644 --- a/formatters/build.gradle +++ b/formatters/build.gradle @@ -26,7 +26,7 @@ spotless { 'spine-sfml/**/*.h', 'spine-ue4/**/*.cpp', 'spine-ue4/**/*.h' - clangFormat('11.0.0-2~ubuntu20.04.1').style('file') + clangFormat().pathToExe("$System.env.CLANGFORMAT").style('file') } typescript {