Skip to content

release workflow

release workflow #20

Workflow file for this run

name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '25 22 * * 6'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ matrix.os }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Release]
c_compiler: [gcc]
cxx_standard: [23]
include:
- build-mode: manual
c_compiler: gcc
cpp_compiler: g++
vcpkgCommitId: '80d54ff62d528339c626a6fbc3489a7f25956ade'
vcpkg_triplet: 'x64-linux'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
# This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch.
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule.
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: '**/vcpkg.json'
- name: Prints output of run-vcpkg's action
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}'"
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}
-DCMAKE_TOOLCHAIN_FILE="${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet}}
-DHDF5_LINK_STATICALLY=ON
-S ${{ github.workspace }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: c-cpp
build-mode: ${{ matrix.build-mode }}
# 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
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"