Skip to content

Commit

Permalink
for loop in clang.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-marcisovsky committed Mar 7, 2024
1 parent 88734f4 commit 66a4b72
Showing 1 changed file with 65 additions and 25 deletions.
90 changes: 65 additions & 25 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ on:
branches:
- master

parameters:
- name: modules
type: object
default:
- name: 'esp_tinyusb'
path: 'device/esp_tinyusb/test_app'
- name: 'hid'
path: 'host/class/hid/usb_host_hid/test_app'

jobs:
build:
name: Run clang-tidy
Expand Down Expand Up @@ -37,37 +46,68 @@ jobs:
IDF_TARGET: esp32s3
run: |
. ${IDF_PATH}/export.sh
idf.py clang-check --project-dir device/esp_tinyusb/test_app --run-clang-tidy-py run-clang-tidy
mv device/esp_tinyusb/test_app/warnings.txt warnings_device.txt
for module in ${{ parameters.modules}}; do
echo "${{ module.path }}"
echo "${{ module.name }}"
idf.py clang-check --project-dir ${{ module.path }} --run-clang-tidy-py run-clang-tidy
mv ${{ module.path }}/warnings.txt warnings_${{ module.name }}.txt
done
idf.py clang-check --project-dir host/class/hid/usb_host_hid/test_app --run-clang-tidy-py run-clang-tidy
mv host/class/hid/usb_host_hid/test_app/warnings.txt warnings_host.txt
- name: Convert clang-tidy results into SARIF output
run: |
export PATH=$PWD:$PATH
./clang-tidy-sarif -o results_device.sarif.raw warnings_device.txt
python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results_device.sarif --include-prefix ${GITHUB_WORKSPACE}/ results_device.sarif.raw
for module in ${{ parameters.modules }}; do
./clang-tidy-sarif -o results_${{ module.name }}.sarif.raw warnings_${{ module.name }}.txt
python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results_${{ module.name }}.sarif --include-prefix ${GITHUB_WORKSPACE}/ results_${{ module.name }}.sarif.raw
done
./clang-tidy-sarif -o results_host.sarif.raw warnings_host.txt
python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results_host.sarif --include-prefix ${GITHUB_WORKSPACE}/ results_host.sarif.raw
- uses: actions/upload-artifact@v2
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
path: |
warnings_device.txt
warnings_host.txt
results_device.sarif
results_host.sarif
results_device.sarif.raw
results_host.sarif.raw
- name: Upload SARIF device file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results_device.sarif
category: clang-tidy-device
**/.txt
**/.sarif
**/.sarif.raw
- name: Upload SARIF host file
- name: Upload SARIF files
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results_host.sarif
category: clang-tidy-host
- ${{ each module in parameters.modules}}
with:
sarif_file: results_${{ module.name }}.sarif
category: clang-tidy-${{ module.name }}

# run: |
# . ${IDF_PATH}/export.sh
# idf.py clang-check --project-dir device/esp_tinyusb/test_app --run-clang-tidy-py run-clang-tidy
# mv device/esp_tinyusb/test_app/warnings.txt warnings_device.txt
#
# idf.py clang-check --project-dir host/class/hid/usb_host_hid/test_app --run-clang-tidy-py run-clang-tidy
# mv host/class/hid/usb_host_hid/test_app/warnings.txt warnings_host.txt
# - name: Convert clang-tidy results into SARIF output
# run: |
# export PATH=$PWD:$PATH
# ./clang-tidy-sarif -o results_device.sarif.raw warnings_device.txt
# python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results_device.sarif --include-prefix ${GITHUB_WORKSPACE}/ results_device.sarif.raw
#
# ./clang-tidy-sarif -o results_host.sarif.raw warnings_host.txt
# python3 $GITHUB_WORKSPACE/.github/filter_sarif.py -o results_host.sarif --include-prefix ${GITHUB_WORKSPACE}/ results_host.sarif.raw
# - uses: actions/upload-artifact@v2
# with:
# path: |
# warnings_device.txt
# warnings_host.txt
# results_device.sarif
# results_host.sarif
# results_device.sarif.raw
# results_host.sarif.raw
# - name: Upload SARIF device file
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: results_device.sarif
# category: clang-tidy-device
#
# - name: Upload SARIF host file
# uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: results_host.sarif
# category: clang-tidy-host

0 comments on commit 66a4b72

Please sign in to comment.