From fb21b13a73457c8a68a7aca41d80e7f292929d1f Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Wed, 19 Mar 2025 13:56:21 -0700 Subject: update workflow files to split codeql analysis for push and PR (#1273) * update workflow files to split codeql analysis for push and PR * test changing a file * remove build all option in script for testing. * Revert "remove build all option in script for testing." This reverts commit 04eb2c34aac69545b56ff86b6d642e453bde89f0. * Revert "test changing a file" This reverts commit d69205126f62ad44af4c5e3b64f1f14637116ea2. * combine pr and push analysis files to remove warning about not having on.push trigger. include script changes and file change for testing * remove test changes --- .github/workflows/Code-Scanning.yml | 48 +++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to '.github/workflows/Code-Scanning.yml') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 72e9c32c..e843271f 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -24,8 +24,9 @@ on: workflow_dispatch: jobs: - analyze: - name: Analysis + analyze-push: + name: Analysis-Push + if: github.event_name == 'push' runs-on: windows-latest permissions: actions: read @@ -62,3 +63,46 @@ jobs: uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" + analyze-pr: + name: Analysis-PR + if: github.event_name == 'pull_request' + runs-on: windows-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: manual + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + - name: Get changed files + id: get-changed-files + uses: tj-actions/changed-files@v41 + with: + separator: "," + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development + packs: +microsoft/windows-drivers@1.2.0-beta + - if: matrix.build-mode == 'manual' + run: | + $changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',') + .\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" \ No newline at end of file -- cgit v1.3.1 From 52908d7718c6fac2953055db2e5d23537957c7af Mon Sep 17 00:00:00 2001 From: Jacob Ronstadt <147542405+jacob-ronstadt@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:59:45 -0700 Subject: Update Code-Scanning.yml to use latest windows-drivers pack (#1277) * Update Code-Scanning.yml to use latest windows-drivers pack * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml * Update Code-Scanning.yml: reduce duplacate code --- .github/workflows/Code-Scanning.yml | 59 +++++++++---------------------------- 1 file changed, 14 insertions(+), 45 deletions(-) (limited to '.github/workflows/Code-Scanning.yml') diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index e843271f..63e155c9 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -24,48 +24,8 @@ on: workflow_dispatch: jobs: - analyze-push: - name: Analysis-Push - if: github.event_name == 'push' - runs-on: windows-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - name: Install Nuget Packages - run: nuget restore .\packages.config -PackagesDirectory .\packages\ - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development - packs: +microsoft/windows-drivers@1.2.0-beta - - name: Retrieve and build all available solutions - run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 - env: - WDS_Configuration: Debug - WDS_Platform: x64 - WDS_WipeOutputs: ${{ true }} - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" - analyze-pr: - name: Analysis-PR - if: github.event_name == 'pull_request' + analyze: + name: Analysis runs-on: windows-latest permissions: actions: read @@ -97,12 +57,21 @@ jobs: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development - packs: +microsoft/windows-drivers@1.2.0-beta - - if: matrix.build-mode == 'manual' + - if: github.event_name == 'pull_request' run: | $changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',') .\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} + - if: github.event_name == 'push' + run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 + env: + WDS_Configuration: Debug + WDS_Platform: x64 + WDS_WipeOutputs: ${{ true }} - name: Perform CodeQL analysis uses: github/codeql-action/analyze@v3 with: - category: "/language:${{matrix.language}}" \ No newline at end of file + category: "/language:${{matrix.language}}" -- cgit v1.3.1