name: rocprofiler-sdk Advanced Analysis on: workflow_dispatch: pull_request: paths: - '.github/workflows/rocprofiler-sdk-codeql.yml' - '.github/actions/rocprofiler-sdk-util/action.yml' - 'projects/rocprofiler-sdk/**' - '!**/*.md' - '!**/*.rtf' - '!**/*.rst' - '!**/.markdownlint-ci2.yaml' - '!**/.readthedocs.yaml' - '!**/.spellcheck.local.yaml' - '!**/.wordlist.txt' - '!projects/rocprofiler-sdk/CODEOWNERS' - '!projects/rocprofiler-sdk/source/docs/**' push: branches: - develop paths: - '.github/workflows/rocprofiler-sdk-codeql.yml' - '.github/actions/rocprofiler-sdk-util/action.yml' - 'projects/rocprofiler-sdk/**' - '!**/*.md' - '!**/*.rtf' - '!**/*.rst' - '!**/.markdownlint-ci2.yaml' - '!**/.readthedocs.yaml' - '!**/.spellcheck.local.yaml' - '!**/.wordlist.txt' - '!projects/rocprofiler-sdk/CODEOWNERS' - '!projects/rocprofiler-sdk/source/docs/**' env: ROCM_PATH: "/opt/rocm" GPU_TARGETS: "gfx906;gfx908;gfx90a;gfx942;gfx950;gfx1030;gfx1100;gfx1101;gfx1102;gfx1201" PATH: "/usr/bin:$PATH" SUBMODULE_PATHS: "projects/rocprofiler-sdk projects/clr projects/hip" EXCLUDED_PATHS: "external /tmp/build/external" GLOBAL_CMAKE_OPTIONS: "-DROCPROFILER_DISABLE_ATT_QUICK_SCAN=ON" ENABLE_ROCR_BUILD: "false" ENABLE_HIP_CLR_BUILD: "false" ENABLE_ROCPROFILER_REGISTER_BUILD: "false" ENABLE_AQLPROFILE_BUILD: "false" jobs: analyze: name: Analyze (${{ matrix.language }}) # Runner size impacts CodeQL analysis time. To learn more, please see: # - https://gh.io/recommended-hardware-resources-for-running-codeql # - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/using-larger-runners (GitHub.com only) # Consider using larger runners or machines with greater resources for possible analysis time improvements. runs-on: azure-linux-scale-rocm container: image: docker.io/rocm/rocprofiler-private:ubuntu-22.04-gfx94X-latest credentials: username: ${{ secrets.ROCPROFILER_AZURE_CI_USER }} password: ${{ secrets.ROCPROFILER_AZURE_CI_PASS }} env: DEBIAN_FRONTEND: noninteractive 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: # cpp analysis disabled - takes too long and frequently times out # - language: cpp # build-mode: manual - language: python build-mode: none - language : actions build-mode: none steps: - name: Install requirements timeout-minutes: 10 shell: bash run: | apt-get update apt-get install -y software-properties-common add-apt-repository -y ppa:git-core/ppa apt-get update apt-get install -y git git config --global --add safe.directory '*' - uses: actions/checkout@v6 with: sparse-checkout: | .github/actions/rocprofiler-sdk-util projects/rocprofiler-sdk projects/clr projects/hip .github/workflows/rocprofiler-sdk-codeql.yml .github/workflows/rocprofiler-sdk-formatting.yml submodules: 'false' - name: Init/Update submodules shell: bash run: | git config --global --add safe.directory '*' git submodule update --init --recursive --jobs 16 -- ${SUBMODULE_PATHS} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Build ROCProfiler SDK Dependencies if: ${{ env.ENABLE_HIP_CLR_BUILD == 'true' }} uses: ./.github/actions/rocprofiler-sdk-util with: rocm-path: ${{ env.ROCM_PATH }} gpu-target: 'gfx94X' compiler-launcher: /usr/bin/ccache enable-rocr-build: ${{ env.ENABLE_ROCR_BUILD }} enable-hip-clr-build: ${{ env.ENABLE_HIP_CLR_BUILD }} enable-rocprofiler-register-build: ${{ env.ENABLE_ROCPROFILER_REGISTER_BUILD }} enable-aqlprofile-build: ${{ env.ENABLE_AQLPROFILE_BUILD }} build-jobs: '8' ccache-key: ccache-codeql-ubuntu-22.04-gfx94X ccache-variant: ccache - name: Configure and Build timeout-minutes: 30 shell: bash run: | cd projects/rocprofiler-sdk python3 -m pip install -U --user -r requirements.txt cmake -B /tmp/build -DCMAKE_PREFIX_PATH=/opt/rocm ${{ env.GLOBAL_CMAKE_OPTIONS }} -DPython3_EXECUTABLE=$(which python3) . cmake --build /tmp/build --target all --parallel 16 rm -rf ${EXCLUDED_PATHS} - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}"