From b96c3aa4cd5028ba74fe9827fa33d4e93d532233 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Thu, 2 May 2024 09:57:55 -0600 Subject: [PATCH] Fixing CodeQL issues --- .github/workflows/codeql.yml | 138 +++++++++++++++++------------------ 1 file changed, 65 insertions(+), 73 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7c99134d65..09319c773f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,15 +13,14 @@ name: "CodeQL" on: push: - branches: ["develop"] + branches: ["master", "develop", "release-*"] pull_request: # The branches below must be a subset of the branches above branches: ["develop"] schedule: - cron: "0 8 * * 0" -permissions: - contents: read +permissions: read-all jobs: analyze: @@ -32,82 +31,75 @@ jobs: contents: read security-events: write - strategy: - fail-fast: false - matrix: - language: ["cpp", "python"] - # CodeQL supports [ $supported-codeql-languages ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - steps: - - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 - with: - egress-policy: audit + - name: Harden Runner + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + with: + egress-policy: audit - - name: checkout_kokkos_kernels - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - with: - path: kokkos-kernels + - name: checkout_kokkos_kernels + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + with: + path: kokkos-kernels - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + with: + languages: c-cpp + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - - name: checkout_kokkos - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - with: - repository: kokkos/kokkos - ref: 4.3.00 - path: kokkos + - name: checkout_kokkos + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + with: + repository: 'kokkos/kokkos' + path: 'kokkos' + ref: '4.3.00' - - name: configure_kokkos - run: | - mkdir -p kokkos/{build,install} - cd kokkos/build - cmake -S $PWD/.. \ - -B $PWD \ - -D Kokkos_ENABLE_SERIAL=ON \ - -D CMAKE_CXX_FLAGS="-Werror" \ - -D CMAKE_CXX_STANDARD=17 \ - -D Kokkos_ENABLE_COMPILER_WARNINGS=ON \ - -D Kokkos_ENABLE_TESTS=OFF \ - -D Kokkos_ENABLE_DEPRECATED_CODE_4=OFF \ - -D CMAKE_BUILD_TYPE=RELEASE \ - -D CMAKE_INSTALL_PREFIX=$PWD/../install + - name: configure_kokkos + run: | + mkdir -p kokkos/{build,install} + cd kokkos/build + cmake -S $PWD/.. \ + -B $PWD \ + -D Kokkos_ENABLE_SERIAL=ON \ + -D CMAKE_CXX_FLAGS="-Werror" \ + -D CMAKE_CXX_STANDARD=17 \ + -D Kokkos_ENABLE_COMPILER_WARNINGS=ON \ + -D Kokkos_ENABLE_TESTS=OFF \ + -D Kokkos_ENABLE_DEPRECATED_CODE_4=OFF \ + -D CMAKE_BUILD_TYPE=RELEASE \ + -D CMAKE_INSTALL_PREFIX=$PWD/../install - - name: build_and_install_kokkos - working-directory: kokkos/build - run: make -j2 install + - name: build_and_install_kokkos + working-directory: kokkos/build + run: make -j2 install - - name: configure_kokkos_kernels - run: | - mkdir -p kokkos-kernels/{build,install} - cd kokkos-kernels/build - cmake \ - -S $PWD/.. - -DKokkos_DIR=$PWD/../../kokkos/install/lib/cmake/Kokkos \ - -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \ - -DCMAKE_CXX_FLAGS="-Wall -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wignored-qualifiers -Wempty-body -Wuninitialized" \ - -DCMAKE_INSTALL_PREFIX=$PWD/../install \ - -DKokkosKernels_ENABLE_TESTS=ON \ - -DKokkosKernels_ENABLE_EXAMPLES:BOOL=ON \ - -DKokkosKernels_INST_DOUBLE=ON \ - -DKokkosKernels_INST_LAYOUTLEFT:BOOL=ON \ - -DKokkosKernels_INST_LAYOUTRIGHT:BOOL=OFF \ - -DKokkosKernels_INST_OFFSET_INT=ON \ - -DKokkosKernels_INST_OFFSET_SIZE_T=OFF + - name: configure_kokkos_kernels + run: | + mkdir -p kokkos-kernels/{build,install} + cd kokkos-kernels/build + cmake \ + -S $PWD/.. + -DKokkos_DIR=$PWD/../../kokkos/install/lib/cmake/Kokkos \ + -DCMAKE_BUILD_TYPE=RELEASE \ + -DCMAKE_CXX_FLAGS="-Wall -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wignored-qualifiers -Wempty-body -Wuninitialized" \ + -DCMAKE_INSTALL_PREFIX=$PWD/../install \ + -DKokkosKernels_ENABLE_TESTS=ON \ + -DKokkosKernels_ENABLE_EXAMPLES:BOOL=ON \ + -DKokkosKernels_INST_DOUBLE=ON \ + -DKokkosKernels_INST_LAYOUTLEFT:BOOL=ON \ + -DKokkosKernels_INST_LAYOUTRIGHT:BOOL=OFF \ + -DKokkosKernels_INST_OFFSET_INT=ON \ + -DKokkosKernels_INST_OFFSET_SIZE_T=OFF - - name: build_kokkos_kernels - working-directory: kokkos-kernels/build - run: make -j2 + - name: build_kokkos_kernels + working-directory: kokkos-kernels/build + run: make -j2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 - with: - category: "/language:${{matrix.language}}" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + with: + category: "/language:c-cpp"