Skip to content

Commit d2eb473

Browse files
authored
Use different clang-tidy CI job that can run on non-PR branches (#342)
* Use different clang-tidy CI job that can run on non-PR branches * Configure permissions * Assume only read permissions for PRs * Clean up commented out code * test CI by inducing a known error * test CI by inducing a known error * Set up dependencies needed for C++ before linting * Include a version of ICU in setup as a dep for the ICU4C executor * Add debug * Remove extra args config * Add manual invocation of clang-tidy * Undo intentional linter error to test manual running of clang-tidy on CI * Remove configs from off-the-shelf GH Actions for clang-tidy / C++ linting
1 parent 734ef2c commit d2eb473

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed
Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: clang-tidy-review
1+
name: Run C++ Tests
22

33
on:
44
push:
@@ -13,29 +13,19 @@ jobs:
1313
name: Lint ICU4C C++ executor
1414
runs-on: ubuntu-latest
1515

16+
permissions:
17+
contents: read # change to write for thread comments
18+
# metadata: read # for thread comments
19+
# pull-requests: write # for pull request reviews
20+
1621
steps:
1722
- uses: actions/checkout@v4
1823

19-
# Optionally generate compile_commands.json
20-
21-
# Run clang-tidy
22-
# Note: when running locally at the command line, use the equivalent
23-
# command when in the directory `executors/cpp`:
24-
# clang-tidy *.cpp --fix-errors --config-file="clang-tidy-config.yml" -p .
25-
# Note: you must run setup.sh and also run install_icu4c_binary.sh (for a given ICU4C version) first
26-
# before running the above clang-tidy command
27-
- uses: ZedThree/clang-tidy-review@v0.14.0
28-
with:
29-
# clang-tidy specific configs
30-
build_dir: './executors/cpp'
31-
config_file: './executors/cpp/clang-tidy-config.yml'
32-
# Action-specific config
33-
split_workflow: true
34-
apt_packages: "libjson-c-dev,libicu-dev"
35-
id: review
36-
37-
- uses: ZedThree/clang-tidy-review/upload@v0.14.0
38-
39-
# If there are any comments, fail the check
40-
- if: steps.review.outputs.total_comments > 0
41-
run: exit 1
24+
- name: Setup deps, etc. # install JSON-C, download ICU4C binaries if not present
25+
run: |
26+
bash setup.sh
27+
sudo apt-get install libicu-dev
28+
- name: Run clang-tidy
29+
run: |
30+
pushd executors/cpp
31+
clang-tidy *.cpp --config-file="clang-tidy-config.yml" -p .

0 commit comments

Comments
 (0)