From ce8cb9ce7e7f1afefbe7b81ec43c2d6d742da489 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 28 Apr 2023 14:01:39 -0700 Subject: [PATCH 1/5] chore: setup clang-tidy --- .clang-tidy | 9 +++++++++ .github/workflows/ci.yml | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..056337b --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,9 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,modernize-*,bugprone-*' +WarningsAsErrors: false +HeaderFilterRegex: '^((?!/external/|bazel-.*).)*$' +AnalyzeTemporaryDtors: false +FormatStyle: file +CheckOptions: {} +... + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b286530..cd9eb99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,20 @@ concurrency: cancel-in-progress: true jobs: - formatting-check: - name: Formatting Check + linter: + name: C/C++ Linter runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: jidicula/clang-format-action@v4.9.0 - with: { clang-format-version: "15" } + - run: 'bazel --bazelrc=.bazelrc --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc build //... -k' + - run: 'bazel --bazelrc=.bazelrc --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc run @hedron_compile_commands//:refresh_all' + - uses: cpp-linter/cpp-linter-action@v2.4.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + files-changed-only: false + test-windows: runs-on: windows-latest steps: @@ -31,6 +38,7 @@ jobs: - run: bazel --bazelrc=.bazelrc --bazelrc=.github/workflows/ci-windows.bazelrc test //... test-linux: runs-on: ubuntu-latest + depends-on: linter steps: - uses: actions/checkout@v3 - name: Mount bazel caches From e82b0c453723f3316bfb764b5aa67edf52c7f202 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 28 Apr 2023 14:03:23 -0700 Subject: [PATCH 2/5] chore: set clang version --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd9eb99..49ea045 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: style: file + version: 16 files-changed-only: false test-windows: From 9239497b8cf0196b64c548dfac6f38be462287f5 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 28 Apr 2023 14:04:36 -0700 Subject: [PATCH 3/5] chore: update github action to use latest clang --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49ea045..f6f4e8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 - run: 'bazel --bazelrc=.bazelrc --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc build //... -k' - run: 'bazel --bazelrc=.bazelrc --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc run @hedron_compile_commands//:refresh_all' - - uses: cpp-linter/cpp-linter-action@v2.4.2 + - uses: cpp-linter/cpp-linter-action@77982d55693d154611fbb8b1304a447c44ae6f2d env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 81ef5fe470751434433ebe9934a191ae159ad706 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 28 Apr 2023 14:10:31 -0700 Subject: [PATCH 4/5] chore: fix gh action syntax --- .clang-tidy | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 056337b..cee9e08 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,7 +1,7 @@ --- Checks: 'clang-diagnostic-*,clang-analyzer-*,modernize-*,bugprone-*' WarningsAsErrors: false -HeaderFilterRegex: '^((?!/external/|bazel-.*).)*$' +HeaderFilterRegex: '^((?!/external/|/bazel-.*/).)*$' AnalyzeTemporaryDtors: false FormatStyle: file CheckOptions: {} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6f4e8d..7984b15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - run: bazel --bazelrc=.bazelrc --bazelrc=.github/workflows/ci-windows.bazelrc test //... test-linux: runs-on: ubuntu-latest - depends-on: linter + needs: linter steps: - uses: actions/checkout@v3 - name: Mount bazel caches From e341f1670dd2b60745376fe1c706678045791305 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Fri, 28 Apr 2023 14:22:10 -0700 Subject: [PATCH 5/5] chore: specify database path --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7984b15..95d7adf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ concurrency: jobs: linter: - name: C/C++ Linter + name: Linter runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -25,6 +25,7 @@ jobs: style: file version: 16 files-changed-only: false + database: '.' test-windows: runs-on: windows-latest