From 2e10c1ff778be2bef1b26b8f11d1ac85b642cf09 Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 22 Apr 2025 16:06:18 +0800 Subject: [PATCH] ci code fomat recache (#6011) --- .github/workflows/code-format.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index a8b73686a..72139874c 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -10,20 +10,22 @@ permissions: contents: write jobs: - code-format: + clang-format: runs-on: ubuntu-latest + container: ubuntu:20.04 steps: - - uses: actions/checkout@v4 - - name: cache-clang-format id: cache-clang-format uses: actions/cache@v4 with: path: clang-format-install - key: clang-format-install-4 + key: clang-format-install-5 - name: clang-format if: steps.cache-clang-format.outputs.cache-hit != 'true' run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -y + apt-get install -y build-essential wget curl cmake unzip zip python3-pip wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-project-10.0.1.tar.xz tar -xf llvm-project-10.0.1.tar.xz cd llvm-project-10.0.1 @@ -37,6 +39,19 @@ jobs: rm -rf llvm-project-10.0.1 rm llvm-project-10.0.1.tar.xz + code-format: + needs: [clang-format] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: cache-clang-format + id: cache-clang-format + uses: actions/cache@v4 + with: + path: clang-format-install + key: clang-format-install-5 + - name: astyle run: | sudo apt-get update @@ -49,6 +64,7 @@ jobs: rm -rf $GITHUB_WORKSPACE/clang-format-install export PATH=~/bin:$PATH sh codeformat.sh + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: apply code-format changes