added codeql workflow #7
Workflow file for this run
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: [ "develop" ] | |
| pull_request: | |
| branches: [ "develop" ] | |
| schedule: | |
| - cron: "16 7 * * 0" | |
| jobs: | |
| analyze: | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Install Dependencies (Linux) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| openmpi-bin openmpi-common mpi-default-dev \ | |
| zlib1g-dev libaec-dev | |
| # Set env vars | |
| echo "CC=mpicc" >> $GITHUB_ENV | |
| echo "FC=mpif90" >> $GITHUB_ENV | |
| echo "F77=mpif90" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Configure HDF5 | |
| run: | | |
| mkdir build; cd build | |
| cmake -G "Unix Makefiles" \ | |
| -DCMAKE_INSTALL_PREFIX=$PWD/hdf5 \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DHDF5_ENABLE_PARALLEL:BOOL=ON \ | |
| -DHDF5_ENABLE_SUBFILING_VFD:BOOL=ON \ | |
| -DHDF5_BUILD_TOOLS:BOOL=ON \ | |
| -DBUILD_SHARED_LIBS:BOOL=ON \ | |
| -DBUILD_STATIC_LIBS:BOOL=OFF \ | |
| -DHDF5_BUILD_FORTRAN:BOOL=OFF \ | |
| -DHDF5_BUILD_JAVA:BOOL=OFF \ | |
| -DBUILD_TESTING:BOOL=OFF \ | |
| -DHDF5_BUILD_EXAMPLES:BOOL=OFF \ | |
| \ | |
| -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON \ | |
| -DZLIB_INCLUDE_DIR=/usr/include \ | |
| -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.so \ | |
| \ | |
| -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON \ | |
| -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON \ | |
| -DCMAKE_INSTALL_PREFIX=/usr/local \ | |
| .. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: c-cpp | |
| build-mode: manual | |
| queries: +security-and-quality | |
| config: | | |
| query-filters: | |
| - exclude: | |
| id: cpp/toctou-race-condition | |
| - exclude: | |
| id: cpp/short-global-name | |
| - name: Build | |
| run: | | |
| cd build | |
| cmake --build . --config Debug | |
| shell: bash | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: "/language:c-cpp" | |
| output: sarif-results | |
| upload: failure-only | |
| - name: filter-sarif | |
| uses: advanced-security/filter-sarif@v1 | |
| with: | |
| patterns: | | |
| -**/test/** | |
| -**/testpar/** | |
| -**/tools/test/** | |
| input: sarif-results/cpp.sarif | |
| output: sarif-results/cpp.sarif | |
| - name: Upload SARIF | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: sarif-results/cpp.sarif |