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 372cb4d commit 17e011b
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 7 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkID=615560

name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.yml
schedule:
- cron: '34 18 * * 6'

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: Clone test repository
uses: actions/checkout@v4
with:
repository: walbourn/directxmathtest
path: Tests
ref: main

- 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}}/Tests/headertest
run: cmake --preset=x64-Debug

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Clone test repository
uses: actions/checkout@v4
with:
repository: walbourn/directxmathtest
path: Tests
ref: main

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

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}

- name: Clone test repository
uses: actions/checkout@v4
with:
repository: walbourn/directxmathtest
path: Tests
ref: main

- name: 'Configure CMake'
working-directory: ${{env.GITHUB_WORKSPACE}}
run: cmake --preset=${{ matrix.build_type }}
Expand Down
2 changes: 2 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@
{ "name": "x86-Release" , "configurePreset": "x86-Release" },
{ "name": "arm64-Debug" , "configurePreset": "arm64-Debug" },
{ "name": "arm64-Release", "configurePreset": "arm64-Release" },
{ "name": "arm64ec-Debug" , "configurePreset": "arm64ec-Debug" },
{ "name": "arm64ec-Release", "configurePreset": "arm64ec-Release" },

{ "name": "x64-Debug-Clang" , "configurePreset": "x64-Debug-Clang" },
{ "name": "x64-Release-Clang" , "configurePreset": "x64-Release-Clang" },
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXMath-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/*'

pr:
Expand All @@ -30,6 +31,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'

resources:
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXMath-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/*.in
Expand All @@ -34,6 +35,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.in
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXMath-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/*'

pr:
Expand All @@ -30,6 +31,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
drafts: false

Expand Down
2 changes: 2 additions & 0 deletions build/DirectXMath-GitHub-WSL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'

pr:
Expand All @@ -30,6 +31,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
drafts: false

Expand Down
2 changes: 2 additions & 0 deletions build/DirectXMath-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/*.in
Expand All @@ -34,6 +35,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.in
Expand Down

0 comments on commit 17e011b

Please sign in to comment.