diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..85166085 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,64 @@ +name: "CodeQL" + +on: + push: + branches: [main, humble, jazzy] + pull_request: + branches: [main, humble, jazzy] + schedule: + - cron: '16 21 * * 6' +permissions: read-all +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + container: + image: osrf/ros:humble-desktop-full + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: manual + - language: python + build-mode: none + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + - if: matrix.build-mode == 'manual' + shell: bash + run: | + source /opt/ros/humble/setup.bash + colcon build --packages-up-to scenario_execution_interfaces + source install/setup.bash + apt update + rosdep update --rosdistro=humble + rosdep install --rosdistro=humble --from-paths scenario_execution_rviz --ignore-src -r -y; + mkdir build_rviz + cd build_rviz + cmake ../scenario_execution_rviz + make + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}"