mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[formatters] Try fixing Clang version in GH workflow
This commit is contained in:
parent
2c6f3a2944
commit
440125252a
55
.github/workflows/format-check-new.yml
vendored
55
.github/workflows/format-check-new.yml
vendored
@ -6,24 +6,27 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Cache Clang
|
- name: Check pre-installed versions
|
||||||
id: cache-clang
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: clang
|
|
||||||
key: ${{ runner.os }}-clang-18-1-8
|
|
||||||
|
|
||||||
- name: Install Clang
|
|
||||||
if: steps.cache-clang.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
run: |
|
||||||
curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-22.04.tar.xz --output clang.tar.xz
|
echo "=== Pre-installed tool versions ==="
|
||||||
tar -xf clang.tar.xz
|
echo "clang-format versions available:"
|
||||||
mv clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-22.04 clang
|
apt list clang-format* 2>/dev/null | grep clang-format || true
|
||||||
|
echo ""
|
||||||
|
echo "Default clang-format:"
|
||||||
|
which clang-format || echo "Not found"
|
||||||
|
clang-format --version || echo "Not installed"
|
||||||
|
echo ""
|
||||||
|
echo "Dart:"
|
||||||
|
which dart || echo "Not found"
|
||||||
|
dart --version || echo "Not installed"
|
||||||
|
|
||||||
|
# clang-format-18 is already pre-installed on Ubuntu 24.04
|
||||||
|
# No need to install it
|
||||||
|
|
||||||
- name: Install dotnet
|
- name: Install dotnet
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
@ -57,22 +60,42 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "=== Tool versions ==="
|
echo "=== Tool versions ==="
|
||||||
echo "clang-format version:"
|
echo "clang-format version:"
|
||||||
`pwd`/clang/bin/clang-format --version
|
clang-format --version
|
||||||
|
echo "clang-format-18 version:"
|
||||||
|
clang-format-18 --version
|
||||||
|
echo "clang-format path:"
|
||||||
|
which clang-format
|
||||||
|
which clang-format-18
|
||||||
|
echo ""
|
||||||
echo "dart version:"
|
echo "dart version:"
|
||||||
dart --version
|
dart --version
|
||||||
echo "dart format help:"
|
echo "dart format help:"
|
||||||
dart format --help | grep -A2 -B2 "page-width" || true
|
dart format --help | grep -A2 -B2 "page-width" || true
|
||||||
|
echo ""
|
||||||
|
echo "Testing clang-format behavior:"
|
||||||
|
echo 'class Test { Test() {}; };' | clang-format --style=file:formatters/.clang-format
|
||||||
|
echo 'class Test { Test() {}; };' | clang-format-18 --style=file:formatters/.clang-format
|
||||||
|
echo ""
|
||||||
|
echo "Testing dart format behavior:"
|
||||||
|
echo 'final x = SpineWidgetController(onInitialized: (c) {print("test");});' | dart format --page-width 120
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
run: |
|
run: |
|
||||||
export CLANGFORMAT=`pwd`/clang/bin/clang-format
|
echo "=== Running formatters ==="
|
||||||
|
echo "Running format-cpp.sh..."
|
||||||
./formatters/format-cpp.sh
|
./formatters/format-cpp.sh
|
||||||
|
echo "Running format-csharp.sh..."
|
||||||
./formatters/format-csharp.sh
|
./formatters/format-csharp.sh
|
||||||
|
echo "Running format-dart.sh..."
|
||||||
./formatters/format-dart.sh
|
./formatters/format-dart.sh
|
||||||
|
echo "Running format-haxe.sh..."
|
||||||
./formatters/format-haxe.sh
|
./formatters/format-haxe.sh
|
||||||
|
echo "Running format-java.sh..."
|
||||||
./formatters/format-java.sh
|
./formatters/format-java.sh
|
||||||
|
echo "Running format-ts.sh..."
|
||||||
./formatters/format-ts.sh
|
./formatters/format-ts.sh
|
||||||
git diff
|
echo "=== Checking differences ==="
|
||||||
|
git diff --stat
|
||||||
git diff > format-diff.txt
|
git diff > format-diff.txt
|
||||||
|
|
||||||
- name: Archive formatting result
|
- name: Archive formatting result
|
||||||
|
|||||||
@ -70,6 +70,7 @@ SpaceBeforeInheritanceColon: true
|
|||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
SpaceBeforeRangeBasedForLoopColon: true
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
SpaceInEmptyParentheses: false
|
SpaceInEmptyParentheses: false
|
||||||
|
SpaceInEmptyBlock: true
|
||||||
SpacesBeforeTrailingComments: 0
|
SpacesBeforeTrailingComments: 0
|
||||||
SpacesInAngles: false
|
SpacesInAngles: false
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user