Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added initial prototype CodeQL SAST Github Actions workflow #1

Open
wants to merge 50 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
001f1fe
added initial prototype CodeQL SAST Github Actions workflow
achauphan Oct 10, 2023
bcabb0c
change CodeQL branch target to only be develop
achauphan Oct 10, 2023
9687203
change configuration to run on a self-hosted runner
achauphan Oct 12, 2023
2cff029
test bare source code CodeQL scan
achauphan Oct 18, 2023
be147e0
re-added cmake build instruction
achauphan Oct 19, 2023
d9e7532
increased make jobs and turned down codeql temp file cleaning level
achauphan Oct 19, 2023
7fba5ee
added container specification for workflow
achauphan Oct 25, 2023
16d1e7f
Fix to use login shell for cmake
sebrowne Oct 25, 2023
eb6a43c
test show modules loaded in container
achauphan Oct 25, 2023
e3ae29c
Manually set up modules on each invocation
sebrowne Oct 25, 2023
555be06
Enable MueLu in scanning for realsies
sebrowne Oct 25, 2023
654d7c9
include building using a GenConfig environment
achauphan Oct 25, 2023
bd76f06
changed hostname to an expected hostname for GenConfig
achauphan Oct 25, 2023
a43a06a
added additional hostname check
achauphan Oct 25, 2023
3b0454a
rewriting hostname in /etc/hostname for GenConfig to recognize
achauphan Oct 25, 2023
e5d016d
forced hostname change during container run in workflow
achauphan Oct 25, 2023
179285f
sourcing modules-init.sh to load correct modules for build
achauphan Oct 25, 2023
6838ada
fix build location
achauphan Oct 25, 2023
59b46d9
corrected source directory location for cmake
achauphan Oct 25, 2023
f3f05ab
corrected ninja build location
achauphan Oct 25, 2023
fe46bac
include Ninja in build
achauphan Oct 25, 2023
81a211c
changed directory for genconfig to build in
achauphan Oct 25, 2023
985ba81
testing a run with make instead of ninja
achauphan Oct 26, 2023
74a0706
removed manually sourced modules-init script after fix in container
achauphan Oct 26, 2023
90e7d4e
see where user is located
achauphan Oct 26, 2023
bb3283c
corrected paths for framework packages
achauphan Oct 26, 2023
ea38294
corrected more paths
achauphan Oct 26, 2023
f677218
corrected source path
achauphan Oct 26, 2023
5160cff
where is this cmake happening?
achauphan Oct 26, 2023
8cdce7f
corrected cmake path
achauphan Oct 26, 2023
f4bf385
changed command sequence
achauphan Oct 26, 2023
6df7a74
updated paths
achauphan Oct 26, 2023
f04e854
fixed paths
achauphan Oct 26, 2023
5b16d5b
find where source is in runner
achauphan Oct 26, 2023
c794bd6
corrected paths to build dir
achauphan Oct 26, 2023
f0ad4cb
adding missing semicolon
achauphan Oct 26, 2023
915ba32
change build instruction to ninja instead of make
achauphan Oct 26, 2023
44897c9
cleaned up codeql workflow yaml file
achauphan Nov 1, 2023
c1ca004
enabled security-extended and security+quality test suites
achauphan Nov 2, 2023
6874b3c
only enabled security-extended
achauphan Nov 2, 2023
5837db9
Merge remote-tracking branch 'upstream/develop' into achauphan/protot…
achauphan Nov 6, 2023
bc1eed3
added rhel8 all-no-epetra build
achauphan Nov 6, 2023
9da1206
changed codeql workflow genconfig build env to all-no-epetra
achauphan Nov 6, 2023
2d774fc
test scan with default codeql queries
achauphan Nov 7, 2023
dbfddfa
turned on all packages including epetra to diagnose ctest failure
achauphan Nov 8, 2023
3eb5461
reverted genconfig build env to rhel8 all-no-epetra
achauphan Nov 8, 2023
9444e77
disabled SEACASAprepro_lib_aprepro_lib_array_test for rhel8 all-no-ep…
achauphan Nov 8, 2023
b676331
turned off SEACASAprepro_lib_aprepro_lib_array_test for base RHEL8 co…
achauphan Nov 8, 2023
e4dd0b9
moved SEACASAprepro_lib_aprepro_lib_array_test OFF
Nov 13, 2023
e7487eb
Run static analysis with new AT2 paradigm
sebrowne Jan 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.

name: "CodeQL"

on:
# push:
# branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
analyze:
name: CodeQL Analyze
runs-on: [self-hosted, triloamd01]
# timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# queries: +security-extended


# Turning off tests to reduce build time and to only scan relevant source code
# Turning off Krino package due to build errors associated with turning off tests
- run: |
bash -l -c "./packages/framework/get_dependencies.sh --container"
bash -l -c "mkdir -p trilinos_build && cd trilinos_build; source ../packages/framework/GenConfig/gen-config.sh rhel8_gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all-no-epetra .."
bash -l -c "cd trilinos_build ; cmake -G Ninja -DTrilinos_ENABLE_TESTS=OFF -DTrilinos_ENABLE_Krino=OFF .."
bash -l -c "cd trilinos_build ; ninja"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

5 changes: 5 additions & 0 deletions packages/framework/ini-files/config-specs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2861,6 +2861,7 @@ opt-set-cmake-var CMAKE_CXX_FLAGS STR

opt-set-cmake-var TPL_ENABLE_SuperLU BOOL FORCE: OFF

opt-set-cmake-var SEACASAprepro_lib_aprepro_lib_array_test_DISABLE BOOL : ON

use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS

Expand All @@ -2871,6 +2872,10 @@ use RHEL8_POST
use rhel8_gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
use PACKAGE-ENABLES|ALL

[rhel8_gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all-no-epetra]
use rhel8_gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
use PACKAGE-ENABLES|ALL-NO-EPETRA

[rhel8_oneapi-intelmpi_release-debug_shared_no-kokkos-arch_no-asan_no-complex_fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all]
use BUILD-TYPE|RELEASE-DEBUG
use KOKKOS-ARCH|NO-KOKKOS-ARCH
Expand Down