mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-08 16:24:53 +08:00
Use Docker for clang-format 18.1.8
This commit is contained in:
parent
8fb6d4c6ef
commit
98ac8553dd
20
.github/workflows/format-check-new.yml
vendored
20
.github/workflows/format-check-new.yml
vendored
@ -11,17 +11,17 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install clang-format 18.1.8
|
||||
- name: Setup clang-format Docker alias
|
||||
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
|
||||
# Create a wrapper script for clang-format that uses Docker
|
||||
sudo tee /usr/local/bin/clang-format <<'EOF'
|
||||
#!/bin/bash
|
||||
# Use Docker to run clang-format 18.1.8
|
||||
docker run --rm -i -v "$PWD":"$PWD" -w "$PWD" silkeh/clang:18 clang-format "$@"
|
||||
EOF
|
||||
sudo chmod +x /usr/local/bin/clang-format
|
||||
# Verify version
|
||||
clang-format --version
|
||||
|
||||
- name: Install dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user