[RNE Rewrite] chore: add clang-tidy static checks #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: clang-tidy | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - rne-rewrite | |
| paths: | |
| - 'packages/react-native-executorch/cpp/**' | |
| - 'packages/react-native-executorch/.clang-tidy' | |
| - 'packages/react-native-executorch/compile_flags.txt' | |
| - 'packages/react-native-executorch/scripts/clang-tidy.sh' | |
| - '.github/workflows/clang-tidy.yml' | |
| workflow_dispatch: | |
| jobs: | |
| clang-tidy: | |
| runs-on: ubuntu-latest | |
| # Dormant until the on-demand header artifact is published (#1283): clang-tidy | |
| # must parse the sources, which needs the ExecuTorch/torch headers that are not | |
| # committed. Enable by setting the repo variable ENABLE_CLANG_TIDY=true once a | |
| # release carrying headers.tar.gz exists for the package version. | |
| if: ${{ vars.ENABLE_CLANG_TIDY == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Install clang-tidy | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang-tidy | |
| clang-tidy --version | |
| - name: Provision ExecuTorch headers | |
| # Reuse the on-demand download flow (#1283). clang-tidy only needs headers | |
| # (it syntax-checks, no linking), so RNET_HEADERS_ONLY fetches just | |
| # headers.tar.gz; RNET_TARGET avoids host platform auto-detection. | |
| working-directory: packages/react-native-executorch | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RNET_HEADERS_ONLY: '1' | |
| RNET_TARGET: android-arm64-v8a | |
| run: node scripts/download-libs.js | |
| - name: Run clang-tidy | |
| run: yarn workspace react-native-executorch lint:cpp |