From b99822c6e8172da040750c56af6e528921a4982a Mon Sep 17 00:00:00 2001 From: Oliver Lee Date: Fri, 28 Jun 2024 03:10:48 -0700 Subject: [PATCH] add check workflow Change-Id: Ib9f4c82cde301397e2f92d9a76b58443dd1a2ca4 --- .github/workflows/check.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..69d7b5e --- /dev/null +++ b/.github/workflows/check.yml @@ -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 }} ]