CodeQL #53
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: CodeQL | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| schedule: | |
| - cron: '0 6 * * 1' # weekly, Monday 06:00 UTC | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| analyze: | |
| name: Analyze (${{ matrix.language }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| security-events: write | |
| actions: read | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - language: javascript-typescript | |
| build-mode: none | |
| - language: c-cpp | |
| build-mode: manual | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - uses: github/codeql-action/init@v3 | |
| with: | |
| languages: ${{ matrix.language }} | |
| build-mode: ${{ matrix.build-mode }} | |
| # Compile the C++ codec (no protoc needed: ProtobufCodec.cpp/Base64.cpp do | |
| # not depend on generated sources) so CodeQL can analyze it. Uses the same | |
| # NitroModules shim as the tests so the <NitroModules/...> includes resolve. | |
| - name: Build C++ codec for CodeQL | |
| if: matrix.language == 'c-cpp' | |
| run: | | |
| NM=node_modules/react-native-nitro-modules/cpp | |
| RN=node_modules/react-native/ReactCommon/jsi | |
| mkdir -p .codeql-shim | |
| ln -sfn "$PWD/$NM/core" .codeql-shim/NitroModules | |
| clang++ -std=c++20 -c cpp/ProtobufCodec.cpp cpp/Base64.cpp \ | |
| -I .codeql-shim -I cpp -I cpp/nanopb -I "$NM/core" -I "$NM/utils" -I "$RN" | |
| - uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: '/language:${{ matrix.language }}' |