avoid generating the same output from multiple actions #81
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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ "*" ] | |
types: [synchronize, opened, reopened, edited] | |
workflow_dispatch: | |
env: | |
CC: clang | |
jobs: | |
buildifier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- shell: bash | |
run: | | |
bazel run //tools:buildifier.check | |
check-tidy-matrix: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- bazel: latest | |
clang: 18 | |
- bazel: latest | |
clang: 17 | |
- bazel: latest | |
clang: 16 | |
- bazel: latest | |
clang: 15 | |
- bazel: latest | |
clang: 14 | |
- bazel: 7.x | |
clang: 18 | |
- bazel: 6.x | |
clang: 18 | |
- bazel: 5.x | |
clang: 18 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install clang ${{ matrix.clang }} | |
uses: ./.github/actions/setup-env | |
with: | |
clang: ${{ matrix.clang }} | |
- name: run clang-tidy | |
shell: bash | |
env: | |
USE_BAZEL_VERION: ${{ matrix.bazel }} | |
run: | | |
set -x | |
cd example | |
if [[ "${{ matrix.bazel }}" < 6 ]]; then | |
sed -i '/enable_bzlmod/d' .bazelrc | |
fi | |
bazel build \ | |
--announce_rc \ | |
--config=clang-tidy \ | |
--color=yes \ | |
//... | tee log || true | |
grep "error: .*misc-unused-alias-decls" log | |
check-tidy-extra-options: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install clang | |
uses: ./.github/actions/setup-env | |
- name: run clang-tidy | |
shell: bash | |
run: | | |
set -x | |
cd example | |
bazel build \ | |
--announce_rc \ | |
--config=clang-tidy \ | |
--color=yes \ | |
--@rules_clang_tidy//:extra-options=--enable-check-profile \ | |
--@rules_clang_tidy//:extra-options=--checks='fuchsia-*' \ | |
//... 2>&1 | tee log || true | |
grep "clang-tidy checks profiling" log | |
grep "error: .*misc-unused-alias-decls" log | |
grep "error: .*fuchsia-trailing-return" log | |
all: | |
runs-on: ubuntu-latest | |
if: ${{ github.base_ref == 'main' }} | |
needs: | |
- buildifier | |
- check-tidy-matrix | |
- check-tidy-extra-options | |
steps: | |
- run: true |