Skip to content

Commit

Permalink
ci: Attempting to simplify CodqQL to run in one YML file
Browse files Browse the repository at this point in the history
Attempting to get both Windows and Linux CodeQL runs in a single YML file to simplify the build process.

Signed-off-by: Tyler Erickson <[email protected]>
  • Loading branch information
vonericsen committed Apr 29, 2024
1 parent 7b92b00 commit 4a1bb42
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -65,11 +99,13 @@ jobs:
# uses a compiled language

- name: Configuring and compiling with meson
uses: BSFishy/[email protected]
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

0 comments on commit 4a1bb42

Please sign in to comment.