Skip to content

Commit

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

name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '43 3 * * 3'

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"
13 changes: 10 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# http://go.microsoft.com/fwlink/?LinkId=248926

name: 'CMake (Windows)'
name: 'CMake'

on:
push:
Expand Down Expand Up @@ -59,19 +59,26 @@ jobs:
- os: windows-2022
build_type: arm64ec-Release
arch: amd64_arm64
- os: ubuntu-latest
build_type: x64-Debug-Linux
arch: none
- os: ubuntu-latest
build_type: x64-Release-Linux
arch: none

steps:
- uses: actions/checkout@v4

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

- uses: ilammy/msvc-dev-cmd@v1
- if: matrix.arch != 'none'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}

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

- name: 'Build'
Expand Down

0 comments on commit 4548ea4

Please sign in to comment.