Skip to content

Commit

Permalink
add check workflow
Browse files Browse the repository at this point in the history
Change-Id: Ib9f4c82cde301397e2f92d9a76b58443dd1a2ca4
  • Loading branch information
oliverlee committed Jun 28, 2024
1 parent d7c679e commit b99822c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: check

on:
push:
branches: [ main ]
pull_request:
branches: [ "*" ]
types: [synchronize, opened, reopened, edited]
workflow_dispatch:

jobs:
check-format:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- example: default
errors: 3
- example: format-binary
errors: 2
- example: format-config
errors: 0
- example: format-ignore
errors: 0
steps:
- uses: actions/checkout@v4
- run: |
cd example/${{ matrix.example }}
bazel build \
--config=clang-format \
--color=yes \
//... 2>&1 | tee log
[ $(cat log | grep -c "Wclang-format-violations") -eq ${{ matrix.errors }} ]

0 comments on commit b99822c

Please sign in to comment.