Skip to content

.sync: Add CodeQL GitHub workflow#133

Merged
makubacki merged 5 commits into
microsoft:mainfrom
makubacki:add_codeql_workflow
Feb 28, 2023
Merged

.sync: Add CodeQL GitHub workflow#133
makubacki merged 5 commits into
microsoft:mainfrom
makubacki:add_codeql_workflow

Conversation

@makubacki
Copy link
Copy Markdown
Member

@makubacki makubacki commented Feb 27, 2023

Adds a new workflow that is synced to Mu repos that are
currently expected to run against CodeQL.

This workflow has the following features to support
maintainability across the repos it is synced to:

  • The packages are auto discovered and a dynamic matrix
    is generated for each package build. This allows the
    same file to work as-is in each repo that performs
    CI builds (packages are in the repo root directory).

  • The Mu Basecore plugin directory is auto discovered
    in the workspace based on the presence of the CodeQL
    plugin being present in the directory.

  • The operations supported by the Stuart CI script are
    dynamically discovered.

  • CodeQL is only run on Windows agents. There is a known
    issue when building edk2-style code on Linux so this
    avoids encountering that issue.

    See: Perform CodeQL Analysis fails during database finalize due to NoSuchFileException github/codeql-action#1338

  • The Windows CodeQL CLI package is about 260MB at this time.

    The GitHub Action cache is used by this workflow to cache
    the CLI after it is initially pulled down in the Stuart ext
    dep update.

  • The CLI ext dep directory name and version used for caching
    are read from the ext_dep YAML file to reduce maintenance
    needed in the workflow if the file changes in the future.

Note that the SARIF file for each run is uploaded as a per-package
artifact. These can be downloaded and opened in VS Code with the
SARIF Viewer extension to view issues locally with the ability
to click to issue locations in files.

Signed-off-by: Michael Kubacki michael.kubacki@microsoft.com

Adds a new workflow that is synced to Mu repos that are currently
expected to have clean CodeQL results.
- Sort packages (consistent order in UI)
- Dynamically determine stuart operations supported in a build script
- Add CI Setup support
- Dynamically discover Mu Basecore plugin directory in a workspace
@makubacki makubacki merged commit 83c3e6b into microsoft:main Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants