[TEST] Troubleshoot failing CI #523
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: Check Formatting | |
on: [pull_request] | |
jobs: | |
check-format: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: Install dependencies from APT | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 18 | |
sudo apt install -y git clang-format-18 | |
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 100 | |
sudo update-alternatives --set clang-format /usr/bin/clang-format-18 | |
- name: Check Formatting | |
run: | | |
echo "Start of script" | |
cd ${{ github.workspace }} | |
echo "Pre-git reset" | |
git reset --soft $(git merge-base HEAD origin/master) | |
echo "Pre-find diff" | |
diff=$(git clang-format-18 --style=file --diff 2>&1) | |
echo "Pre-diff check" | |
if [ $(echo "${diff}" | wc -l) != 1 ]; then | |
echo "Formatting errors detected! Suggested changes:" | |
echo "${diff}" | |
exit 5 | |
else | |
echo "No formatting errors detected!" | |
exit 0 | |
fi |