mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
79 lines
3.3 KiB
YAML
79 lines
3.3 KiB
YAML
name: Test Clang Format Install
|
|
|
|
on:
|
|
push:
|
|
branches: [test-clang-format-install]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test-ubuntu-2204:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Install clang-format 18.1.8
|
|
run: |
|
|
echo "=== System info ==="
|
|
lsb_release -a
|
|
echo ""
|
|
echo "=== Available libtinfo packages ==="
|
|
apt-cache search libtinfo | grep -E "^libtinfo[0-9]* " || true
|
|
echo ""
|
|
echo "=== Installing dependencies ==="
|
|
sudo apt-get update
|
|
# Try libtinfo6 first (newer), fall back to libtinfo5
|
|
sudo apt-get install -y libtinfo6 || sudo apt-get install -y libtinfo5
|
|
echo ""
|
|
echo "=== Downloading 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
|
|
echo ""
|
|
echo "=== Extracting ==="
|
|
tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
|
|
echo ""
|
|
echo "=== Testing clang-format ==="
|
|
# First check what libraries it needs
|
|
ldd ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format || true
|
|
echo ""
|
|
# Try to run it
|
|
./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version || {
|
|
echo "Failed to run, trying with symlink..."
|
|
sudo ln -sf /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
|
|
./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version
|
|
}
|
|
echo ""
|
|
echo "=== Testing formatting ==="
|
|
echo 'class Test { Test() {}; };' | ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format
|
|
|
|
test-ubuntu-2404:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Install clang-format 18.1.8
|
|
run: |
|
|
echo "=== System info ==="
|
|
lsb_release -a
|
|
echo ""
|
|
echo "=== Available libtinfo packages ==="
|
|
apt-cache search libtinfo | grep -E "^libtinfo[0-9]* " || true
|
|
echo ""
|
|
echo "=== Installing dependencies ==="
|
|
sudo apt-get update
|
|
# Try libtinfo6 first (newer), fall back to libtinfo5
|
|
sudo apt-get install -y libtinfo6 || sudo apt-get install -y libtinfo5
|
|
echo ""
|
|
echo "=== Downloading 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
|
|
echo ""
|
|
echo "=== Extracting ==="
|
|
tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz
|
|
echo ""
|
|
echo "=== Testing clang-format ==="
|
|
# First check what libraries it needs
|
|
ldd ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format || true
|
|
echo ""
|
|
# Try to run it
|
|
./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version || {
|
|
echo "Failed to run, trying with symlink..."
|
|
sudo ln -sf /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
|
|
./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version
|
|
}
|
|
echo ""
|
|
echo "=== Testing formatting ==="
|
|
echo 'class Test { Test() {}; };' | ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format |