Skip to content

Minor fixes to help output from test clients #7

Minor fixes to help output from test clients

Minor fixes to help output from test clients #7

Workflow file for this run

name: "CodeQL Advanced"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "16 7 * * 0"
jobs:
analyze:
name: Analyze
# 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: ubuntu-latest
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Install Dependencies (Linux)
run: |
sudo gem install apt-spy2
sudo apt-spy2 check
sudo apt-spy2 fix --commit
sudo apt update
sudo apt upgrade
sudo apt-get install -qq libhdf5-dev
sudo apt-get install -qq hdf5-tools
echo "HDF5_HOME=/usr/include/hdf5/serial,/usr/lib/x86_64-linux-gnu/hdf5/serial,/usr/bin" >> $GITHUB_ENV
# Set env vars
echo "CC=gcc" >> $GITHUB_ENV
echo "FC=gfortran" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
##################################
# INSTALL ZFP
##################################
- name: install ZFP
run: |
git clone https://github.com/LLNL/zfp.git
export HOME_DIR=$(echo ~)
cd zfp
mkdir build;cd build
cmake -D ZFP_BIT_STREAM_WORD_SIZE=8 -D BUILD_CFP=ON -D CMAKE_INSTALL_PREFIX=$PWD/zfp -D BUILD_TESTING=OFF -D BUILD_UTILITIES=OFF ..
make install
echo "ZFP_HOME=$PWD/zfp" >> $GITHUB_ENV
echo "ZFP_DIR=$PWD/zfp" >> $GITHUB_ENV
shell: bash
##################################
# BUILD AND TEST H5Z-ZFP
##################################
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: c-cpp
build-mode: manual
# 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.
# For more details on CodeQL's query packs, refer to:
#https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
config: |
query-filters:
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-guarded-free/
id: cpp/guarded-free
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-unused-static-function/
id: cpp/unused-static-function
queries: +security-extended,security-and-quality
- name: configure h5z-zfp
run: |
mkdir build; cd build
cmake -D FORTRAN_INTERFACE=ON -D CMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ..
shell: bash
- name: build and test
run: |
cd build
cmake --build .
ctest -C Debug .
shell: bash
# NOTE: C/C++ does not support path-based filtering when using the manual build mode.
# The "paths" and "paths-ignore" configuration properties will have no effect for this
# language. If desired, you can use the advanced-security/filter-sarif Action to rewrite
# the SARIF file to exclude alerts from these paths. For more information,
# see https://github.com/advanced-security/filter-sarif
- 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@main
with:
patterns: |
-**/*
src/**/*
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
- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v4
with:
name: sarif-results
path: sarif-results
retention-days: 1