From 4a1bb422baced0436ca01bbd0ebae161e2e9ba79 Mon Sep 17 00:00:00 2001 From: Tyler Erickson Date: Mon, 29 Apr 2024 11:32:13 -0600 Subject: [PATCH] ci: Attempting to simplify CodqQL to run in one YML file Attempting to get both Windows and Linux CodeQL runs in a single YML file to simplify the build process. Signed-off-by: Tyler Erickson --- .github/workflows/codeql-analysis.yml | 50 +++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d8be631..47b2328 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -17,8 +17,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-latest - + runs-on: ${{ matrix.config.os }} strategy: fail-fast: false matrix: @@ -27,6 +26,35 @@ jobs: language: ['cpp'] # Learn more... # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + config: + - { + name: "Windows MSVC x64", + os: windows-latest, + cc: "cl.exe", + cxx: "cl.exe", + arch: "x64", + meson_opts: "-Db_vscrt=static_from_buildtype" + } + - { + name: "Windows MSVC x86", + os: windows-latest, + cc: "cl.exe", + cxx: "cl.exe", + arch: "x64_x86", + meson_opts: "-Db_vscrt=static_from_buildtype" + } + - { + name: "Ubuntu GCC", + os: ubuntu-latest, + cc: "gcc", + cxx: "g++" + } + - { + name: "Ubuntu Clang", + os: ubuntu-latest, + cc: "clang", + cxx: "clang++" + } steps: - name: Checkout repository @@ -36,6 +64,12 @@ jobs: # a pull request then we can checkout the head. fetch-depth: 2 submodules: recursive + + - name: Settings vars for MSVC + if: startsWith(matrix.config.name, 'Windows MSVC') + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.config.arch }} # If this run was triggered by a pull request event, then checkout # the head of the pull request instead of the merge commit. @@ -65,11 +99,13 @@ jobs: # uses a compiled language - name: Configuring and compiling with meson - uses: BSFishy/meson-build@v1.0.3 - with: - action: build - options: --verbose - meson-version: 0.60.1 + env: + CC: ${{ matrix.config.cc }} + CXX: ${{ matrix.config.cxx }} + run: | + pip install meson==0.60.3 ninja + meson setup build -Dprefix=/ -Dmandir=/man -Dbindir=/ ${{ matrix.config.meson_opts }} --buildtype=release + meson install -C build - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3