From a3debfe382e9bc5a3e1d17ca7e34821b0fc08f25 Mon Sep 17 00:00:00 2001 From: Pierre Gergondet Date: Tue, 31 May 2022 15:25:45 +0800 Subject: [PATCH] [ci] Switch to clang-format 10 --- .clang-format-common.sh | 8 ++++---- .github/workflows/build.yml | 15 --------------- .github/workflows/clang-format.yml | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/clang-format.yml diff --git a/.clang-format-common.sh b/.clang-format-common.sh index 88b367a97..df89ecb36 100644 --- a/.clang-format-common.sh +++ b/.clang-format-common.sh @@ -1,12 +1,12 @@ # This script is meant to be sourced from other scripts -# Check for clang-format, prefer 6.0 if available -if [[ -x "$(command -v clang-format-6.0)" ]]; then - clang_format=clang-format-6.0 +# Check for clang-format, prefer 10 if available +if [[ -x "$(command -v clang-format-10)" ]]; then + clang_format=clang-format-10 elif [[ -x "$(command -v clang-format)" ]]; then clang_format=clang-format else - echo "clang-format or clang-format-6.0 must be installed" + echo "clang-format or clang-format-10 must be installed" exit 1 fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f46ff7756..7df9b11b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,22 +13,7 @@ on: - '**' jobs: - - clang-format: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v1 - - name: Install clang-format-6.0 - run: | - sudo apt-get -qq update - sudo apt-get -qq remove clang-6.0 libclang1-6.0 libclang-common-6.0-dev libllvm6.0 - sudo apt-get -qq install clang-format-6.0 clang-format - - name: Run clang-format-check - run: | - ./.clang-format-check.sh - build: - needs: clang-format strategy: fail-fast: false matrix: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 000000000..b29d42057 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,29 @@ +name: Check formatting of Tasks sources + +on: + push: + paths-ignore: + # Changes to those files don't mandate running CI + - ".github/workflows/sources/*" + - ".github/workflows/build.yml" + - ".github/workflows/conan.yml" + - ".github/workflows/package.yml" + - "debian/**" + branches: + - '**' + pull_request: + branches: + - '**' +jobs: + clang-format: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install clang-format-10 + run: | + sudo apt-get -qq update + sudo apt-get -qq install clang-format-10 + - name: Run clang-format-check + run: | + ./.clang-format-check.sh +