mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
name: Formatting
|
|
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- 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 |