Skip to content

Commit

Permalink
Add CodeQL using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Jul 25, 2024
1 parent 15b5188 commit f804f1c
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248929

name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.yml
schedule:
- cron: '31 2 * * 5'

jobs:
analyze:
name: Analyze (C/C++)
runs-on: windows-latest
timeout-minutes: 360
permissions:
security-events: write
packages: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: 'Install Ninja'
run: choco install ninja

- uses: ilammy/msvc-dev-cmd@v1

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: c-cpp
build-mode: manual

- name: 'Configure CMake'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: cmake --preset=x64-Debug

- name: 'Build'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: cmake --build out\build\x64-Debug

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"
2 changes: 2 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@
{ "name": "x86-Release" , "configurePreset": "x86-Release" },
{ "name": "arm64-Debug" , "configurePreset": "arm64-Debug-Win10" },
{ "name": "arm64-Release", "configurePreset": "arm64-Release-Win10" },
{ "name": "arm64ec-Debug" , "configurePreset": "arm64ec-Debug-Win10" },
{ "name": "arm64ec-Release", "configurePreset": "arm64ec-Release-Win10" },

{ "name": "x64-Debug-Win7" , "configurePreset": "x64-Debug-Win7" },
{ "name": "x64-Release-Win7" , "configurePreset": "x64-Release-Win7" },
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-CMake-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-CMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -39,6 +40,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-GDK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -39,6 +40,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-MinGW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -39,6 +40,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTK-GitHub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -39,6 +40,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down

0 comments on commit f804f1c

Please sign in to comment.