mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: Formatting
|
|
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install clang-format 18.1.8
|
|
run: |
|
|
# Install dependencies
|
|
sudo apt-get update
|
|
sudo apt-get install -y libtinfo5
|
|
# Download clang-format 18.1.8
|
|
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang%2Bllvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
|
|
tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
|
|
# Use only clang-format from the package
|
|
sudo cp clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format /usr/local/bin/clang-format
|
|
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/local/bin/clang-format 100
|
|
|
|
- name: Install dotnet
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: "8.0.x"
|
|
|
|
- name: Install Node and dependencies
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "24"
|
|
# NOTE: typescript-formatter is installed by npm in spine-ts
|
|
|
|
- name: Install JDK
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: "16"
|
|
|
|
- name: Install Haxe
|
|
uses: krdlab/setup-haxe@v1
|
|
with:
|
|
haxe-version: '4.3.2'
|
|
- run: haxelib install formatter
|
|
|
|
- name: Install Dart
|
|
uses: dart-lang/setup-dart@v1
|
|
with:
|
|
sdk: '3.8.1'
|
|
|
|
- name: Check dart format version
|
|
run: |
|
|
dart format --version
|
|
|
|
- name: Format
|
|
run: |
|
|
./formatters/format-cpp.sh
|
|
./formatters/format-csharp.sh
|
|
./formatters/format-dart.sh
|
|
./formatters/format-haxe.sh
|
|
./formatters/format-java.sh
|
|
./formatters/format-ts.sh
|
|
git diff > format-diff.txt
|
|
|
|
- name: Archive formatting result
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: format-diff
|
|
path: format-diff.txt
|
|
|
|
- name: Fail on format changes
|
|
run: |
|
|
git ls-files -m
|
|
if [[ `git ls-files -m` ]]; then echo "Detected formatting errors!" & exit 1; fi |