mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-27 12:11:22 +08:00
Add setup script for Docker clang-format wrapper
This commit is contained in:
parent
c8421648b5
commit
aaaa3f8f35
15
.github/workflows/format-check-new.yml
vendored
15
.github/workflows/format-check-new.yml
vendored
@ -12,20 +12,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup clang-format
|
- name: Setup clang-format
|
||||||
run: |
|
run: ./formatters/setup-clang-format-docker.sh
|
||||||
# Pull the Docker image with clang-format 18
|
|
||||||
docker pull silkeh/clang:18
|
|
||||||
|
|
||||||
# Create a wrapper script that runs clang-format in Docker
|
|
||||||
sudo tee /usr/local/bin/clang-format > /dev/null <<'EOF'
|
|
||||||
#!/bin/bash
|
|
||||||
exec 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 and location
|
|
||||||
which clang-format
|
|
||||||
clang-format --version
|
|
||||||
|
|
||||||
- name: Install dotnet
|
- name: Install dotnet
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
|
|||||||
24
formatters/setup-clang-format-docker.sh
Executable file
24
formatters/setup-clang-format-docker.sh
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Setting up clang-format Docker wrapper..."
|
||||||
|
|
||||||
|
# Pull the Docker image with clang-format 18
|
||||||
|
echo "Pulling Docker image..."
|
||||||
|
docker pull silkeh/clang:18
|
||||||
|
|
||||||
|
# Create a wrapper script that runs clang-format in Docker
|
||||||
|
echo "Creating wrapper script..."
|
||||||
|
cat > /tmp/clang-format-wrapper <<'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
exec docker run --rm -i -v "$PWD:$PWD" -w "$PWD" silkeh/clang:18 clang-format "$@"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Install the wrapper
|
||||||
|
sudo mv /tmp/clang-format-wrapper /usr/local/bin/clang-format
|
||||||
|
sudo chmod +x /usr/local/bin/clang-format
|
||||||
|
|
||||||
|
# Verify version and location
|
||||||
|
echo "Verifying installation..."
|
||||||
|
which clang-format
|
||||||
|
clang-format --version
|
||||||
Loading…
x
Reference in New Issue
Block a user