Skip to content

CodeQL

CodeQL #104

Workflow file for this run

name: CodeQL
on:
workflow_dispatch:
branches: [ master ]
schedule:
- cron: '39 0 * * 1'
env:
VCPKG_VERSION: '64adda19c86e89526b5e27703a193c14477cce07'
jobs:
analyze:
name: 'Windows/2022/CodeQL'
runs-on: windows-2022
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v2
- name: Install vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ runner.workspace }}/vcpkg'
vcpkgGitCommitId: '${{ env.VCPKG_VERSION }}'
vcpkgJsonGlob: 'vcpkg.json'
appendedCacheKey: 'codeql'
- name: Run vcpkg
run: ${{ env.VCPKG_ROOT }}/vcpkg install --recurse --clean-after-build --triplet x64-windows-release --host-triplet x64-windows-release --x-install-root=${{ runner.workspace }}/vcpkg_installed --overlay-ports=${{ github.workspace }}/deps
- name: Configure CMake
run: cmake --preset default -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_INSTALLED_DIR=${{ runner.workspace }}/vcpkg_installed -DVCPKG_MANIFEST_INSTALL=off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=on -DASIO_GRPC_ENABLE_CHECK_HEADER_SYNTAX_TARGET=off
- name: Build
run: cmake --build --preset default --config Release --parallel 1 --target asio-grpc-example-protos asio-grpc-test-protos
- name: Initialize MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@96315324a485db21449515180214ecb78c16a1c5
id: run-analysis
with:
cmakeBuildDirectory: ${{ github.workspace }}/build
buildConfiguration: Release
ruleset: ${{ github.workspace }}/.github/codeql/MsvcRules.ruleset
ignoredPaths: ${{ runner.workspace }}/vcpkg_installed
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}