mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +08:00
Ensure correct clang-format version in CI
This commit is contained in:
parent
3d5a66b5f8
commit
75e7a77e4c
23
.github/workflows/spine-c-bindings-check.yml
vendored
23
.github/workflows/spine-c-bindings-check.yml
vendored
@ -8,30 +8,30 @@ on:
|
||||
jobs:
|
||||
check-bindings:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
|
||||
- name: Check if branch qualifies for bindings check
|
||||
run: |
|
||||
BRANCH_NAME=${GITHUB_REF#refs/heads/}
|
||||
echo "Branch: $BRANCH_NAME"
|
||||
|
||||
|
||||
# Strip -beta suffix and extract version
|
||||
VERSION=$(echo "$BRANCH_NAME" | sed 's/-beta$//')
|
||||
|
||||
|
||||
# Check if it's a version branch (starts with number)
|
||||
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+'; then
|
||||
echo "Not a version branch, skipping bindings check"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# Extract major.minor version
|
||||
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||
MINOR=$(echo "$VERSION" | cut -d. -f2)
|
||||
|
||||
|
||||
# Check if version >= 4.3
|
||||
if [ "$MAJOR" -gt 4 ] || ([ "$MAJOR" -eq 4 ] && [ "$MINOR" -ge 3 ]); then
|
||||
echo "Branch qualifies for bindings check (version $MAJOR.$MINOR >= 4.3)"
|
||||
@ -40,26 +40,29 @@ jobs:
|
||||
echo "Branch version $MAJOR.$MINOR < 4.3, skipping bindings check"
|
||||
echo "SHOULD_CHECK=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
|
||||
- name: Setup Node.js
|
||||
if: env.SHOULD_CHECK == 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
|
||||
- name: Install build dependencies
|
||||
if: env.SHOULD_CHECK == 'true'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential cmake ninja-build
|
||||
|
||||
|
||||
- name: Setup clang-format
|
||||
run: ./formatters/setup-clang-format-docker.sh
|
||||
|
||||
- name: Generate and compile spine-c bindings
|
||||
if: env.SHOULD_CHECK == 'true'
|
||||
run: |
|
||||
cd spine-c
|
||||
./build.sh codegen
|
||||
./build.sh clean
|
||||
|
||||
|
||||
- name: Check for changes in generated bindings
|
||||
if: env.SHOULD_CHECK == 'true'
|
||||
run: |
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user