Skip to content

Commit

Permalink
workflow: Add clang-tidy review workflow
Browse files Browse the repository at this point in the history
Add clang-tidy review workflow

Signed-off-by: Balaji Srinivasan <balaji.srinivasan@nordicsemi.no>
  • Loading branch information
Balaji Srinivasan committed Aug 16, 2023
1 parent 09e9651 commit 1716bf5
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Clang-tidy review
on:
pull_request:

jobs:
build:
name: Clang tidy review
runs-on: ubuntu-latest
container: zephyrprojectrtos/ci:v0.26.4
env:
CMAKE_PREFIX_PATH: /opt/toolchains
steps:
- name: Checkout the code
uses: actions/checkout@v2
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout the PR's head sha instead of the target branch's sha
path: ncs/nrf
fetch-depth: 0

- name: Checkout the code
uses: actions/checkout@v2
if: github.event_name != 'pull_request_target'
with:
path: ncs/nrf
fetch-depth: 0

- name: Install jq
run: |
sudo apt-get update
sudo apt-get install jq
# The docker image comes pre-initialized with west dependencies. We want to do west update ourselves to to be sure that we get the latest changes in all repos.
# The docker image is built nightly. So it may contain slightly out of date repos.
# Hence we remove the .west folder and do a re-init
- name: West init and update
run: |
rm -rf /workdir/.west/
west init -l ncs/nrf
cd ncs
west update --narrow -o=--depth=1
# Download the quarantine file base branch. This is needed to build and run the tests.
- name: Download quarentine file from nrf (PR only)
if: github.event_name == 'pull_request_target'
run: |
wget https://raw.githubusercontent.com/balaji-nordic/sdk-nrf/master/scripts/quarantine_downstream.yaml -P ncs/nrf/scripts/
- name: Build native_posix tests (via sonarcloud build wrapper)
shell: bash
run: |
source ncs/zephyr/zephyr-env.sh
ncs/zephyr/scripts/twister -b -v -i -T ncs/nrf/applications/asset_tracker_v2 -p native_posix --quarantine-list ncs/nrf/scripts/quarantine_downstream.yaml
- name: Use jq to combine compile_commands.json files
run: |
jq -s 'map(.[])' twister-out/**/compile_commands.json > compile_commands.json
- uses: ZedThree/clang-tidy-review@v0.12.0
with:
split_workflow: true

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

0 comments on commit 1716bf5

Please sign in to comment.