diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index e65588e..b3cd6b5 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -15,24 +15,24 @@ jobs: format-check: runs-on: group: default + env: + CLANG_RELEASE: 18 strategy: fail-fast: false - matrix: - release: - - 18 - container: libfn/ci-build-clang:${{ matrix.release }} + container: libfn/ci-build-clang:${{ env.CLANG_RELEASE }} steps: - name: Check version run: | - clang-format --version | grep -F "clang-format version ${{ matrix.release }}" + clang-format --version | grep -F "clang-format version ${CLANG_RELEASE}" - uses: actions/checkout@v4 - name: Format source files - run: find include tests -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${{ matrix.release }} -i + run: find include tests -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.ipp' \) -print0 | xargs -0 clang-format-${CLANG_RELEASE} -i - name: Check for differences id: assert + shell: bash run: | set -o pipefail git diff --exit-code | tee "clang-format.patch" @@ -65,6 +65,6 @@ jobs: in your repo, commit, and push. run: | echo "${PREAMBLE}" - clang-format-${{ matrix.release }} --version + clang-format-${CLANG_RELEASE} --version echo "${SUGGESTION}" exit 1