Skip to content

Add a simple CI

Add a simple CI #14

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
CodeFormatting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get install clang-format-15
go install github.com/bazelbuild/buildtools/buildifier@latest
echo "PATH=$PATH:$(go env GOPATH)/bin/" >> $GITHUB_ENV
- name: Run formatting style check
run: |
scripts/run-format.sh
git diff > /tmp/format-diff
if [ -s "/tmp/format-diff" ]; then
echo "Difference to optimal formatting"
cat /tmp/format-diff
echo
echo "=================== To Fix ==========================="
echo "Run scripts/run-format.sh"
echo "then"
echo " git commit -a --amend"
echo " git push -f"
exit 1
fi