Actions(deps): Bump microsoft/setup-msbuild from 1.1.3 to 2.0.0 #84
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Enforce clang-format clean | |
on: | |
- pull_request | |
- push | |
jobs: | |
build_and_test: | |
name: Enforce clang-format clean | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install clang-format | |
run: |- | |
clang_major_version=14 | |
set -x -u -o pipefail | |
source /etc/os-release | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${clang_major_version} main" | |
sudo apt-get update | |
sudo apt-get install --yes --no-install-recommends -V clang-format-${clang_major_version} | |
echo "/usr/lib/llvm-${clang_major_version}/bin" >> "${GITHUB_PATH}" | |
- name: Enforce clang-format clean | |
run: |- | |
clang_format_args=( | |
-i | |
-style=file | |
-verbose | |
) | |
set -x -u -o pipefail | |
clang-format --version | |
git ls-files '*.c' '*.cpp' '*.h' \ | |
| xargs clang-format "${clang_format_args[@]}" | |
git diff --exit-code # i.e. fail CI on non-empty diff |