Skip to content

Commit

Permalink
Enabling CodeQL scanning (#211)
Browse files Browse the repository at this point in the history
* Enabling Codql

* Refactoring the CodeQl Initialition into a Github custom Action

* Fix Indentation

* Changing casing from CodeQl to CodeQL

---------

Co-authored-by: Olatunde Gbolade <[email protected]>
  • Loading branch information
ogbolade-msft and Olatunde Gbolade authored Nov 14, 2024
1 parent e555d76 commit 52af712
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/initialize-codeql/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Initialize CodeQL

description: Initializes CodeQL action to be used in build workflows

runs:
using: "composite"

steps:
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
6 changes: 6 additions & 0 deletions .github/workflows/main-build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Initialize CodeQL
uses: ./.github/workflows/initialize-codeql

- name: Setup
run: source ./scripts/setup.sh

Expand All @@ -36,3 +39,6 @@ jobs:
run: |
./scripts/build.sh --build-type Release
./scripts/test.sh --output-on-failure
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
6 changes: 6 additions & 0 deletions .github/workflows/main-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Initialize CodeQL
uses: ./.github/workflows/initialize-codeql

- name: Install Winget
uses: ./.github/workflows/install-winget

Expand All @@ -43,3 +46,6 @@ jobs:
run: |
.\scripts\Build.ps1 -BuildType Release
.\scripts\Test.ps1 -OutputOnFailure
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Initialize CodeQL
uses: ./.github/workflows/initialize-codeql

- name: Install Winget
uses: ./.github/workflows/install-winget

Expand All @@ -45,6 +48,9 @@ jobs:
.\scripts\Build.ps1 -EnableTestOverrides
.\scripts\Test.ps1 -OutputOnFailure
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

build-ubuntu:
runs-on: ubuntu-latest

Expand All @@ -58,6 +64,9 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Initialize CodeQL
uses: ./.github/workflows/initialize-codeql

- name: Setup
run: source ./scripts/setup.sh

Expand All @@ -73,3 +82,6 @@ jobs:
run: |
./scripts/build.sh --enable-test-overrides
./scripts/test.sh --output-on-failure
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

0 comments on commit 52af712

Please sign in to comment.