Skip to content

Commit

Permalink
Use different clang-tidy CI job that can run on non-PR branches (#342)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
echeran authored Nov 13, 2024
1 parent 734ef2c commit d2eb473
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: clang-tidy-review
name: Run C++ Tests

on:
push:
Expand All @@ -13,29 +13,19 @@ jobs:
name: Lint ICU4C C++ executor
runs-on: ubuntu-latest

permissions:
contents: read # change to write for thread comments
# metadata: read # for thread comments
# pull-requests: write # for pull request reviews

steps:
- uses: actions/checkout@v4

# Optionally generate compile_commands.json

# Run clang-tidy
# Note: when running locally at the command line, use the equivalent
# command when in the directory `executors/cpp`:
# clang-tidy *.cpp --fix-errors --config-file="clang-tidy-config.yml" -p .
# Note: you must run setup.sh and also run install_icu4c_binary.sh (for a given ICU4C version) first
# before running the above clang-tidy command
- uses: ZedThree/clang-tidy-review@v0.14.0
with:
# clang-tidy specific configs
build_dir: './executors/cpp'
config_file: './executors/cpp/clang-tidy-config.yml'
# Action-specific config
split_workflow: true
apt_packages: "libjson-c-dev,libicu-dev"
id: review

- uses: ZedThree/clang-tidy-review/upload@v0.14.0

# If there are any comments, fail the check
- if: steps.review.outputs.total_comments > 0
run: exit 1
- name: Setup deps, etc. # install JSON-C, download ICU4C binaries if not present
run: |
bash setup.sh
sudo apt-get install libicu-dev
- name: Run clang-tidy
run: |
pushd executors/cpp
clang-tidy *.cpp --config-file="clang-tidy-config.yml" -p .

0 comments on commit d2eb473

Please sign in to comment.