Skip to content

Commit

Permalink
Merge pull request #3 from hzeller/feature-20240428-bant_on_bant
Browse files Browse the repository at this point in the history
CI: run bant on bant to check for proper BUILD dependencies.
  • Loading branch information
hzeller authored Apr 28, 2024
2 parents e01cdc3 + 96721be commit ccc160c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,53 @@ jobs:
exit 1
fi
RunBantOnBant:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create Cache Timestamp
id: cache_timestamp
uses: nanzm/[email protected]
with:
format: 'YYYY-MM-DD-HH-mm-ss'

- name: Mount clang-tidy cache
uses: actions/cache@v4
with:
path: |
~/.cache/bazel
key: bant-on-bant_${{ steps.cache_timestamp.outputs.time }}
restore-keys: bant-on-bant_

- name: Build Compilation DB
run: |
scripts/make-compilation-db.sh
- name: Build bant
run: |
export CC=gcc-13
export CXX=g++-13
bazel build -c opt bant:bant
- name: Run bant on bant
run: |
bazel-bin/bant/bant dwyu ... -v -o/tmp/bant-output.txt
if [ -s "/tmp/bant-output.txt" ]; then
echo "Bant found changes to be made in BUILD files."
echo "======== Findings as buildozer edit script ==========="
echo
cat /tmp/bant-output.txt
echo
echo "=================== To Fix ==========================="
echo "Run"
echo " . <(bazel-bin/bant/bant dwyu ...)"
exit 1
fi
ClangTidy:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit ccc160c

Please sign in to comment.