Skip to content

Commit 99a4974

Browse files
authored
.sync: Add arch sync param to the CodeQL workflow (#571)
Allow the architecture list to be passed into the workflow for matrix generation. All existing repos continue to use the previous default of "IA32,X64", the mu_crypto_release repo only supports X64, so sync it accordingly. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent 55502a6 commit 99a4974

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

.sync/Files.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,15 @@ group:
338338
# Leaf Workflow - CodeQL
339339
# Note: This workflow should be used in repos that build firmware
340340
# packages from a CI builder (i.e. a CISettings.py file).
341+
# IA32 & X64 architectures
341342
- files:
342343
- source: .sync/workflows/leaf/codeql.yml
343344
dest: .github/workflows/codeql.yml
344-
template: true
345+
template:
346+
archs: IA32,X64
345347
repos: |
346348
microsoft/mu_basecore
347349
microsoft/mu_common_intel_min_platform
348-
microsoft/mu_crypto_release
349350
microsoft/mu_feature_config
350351
microsoft/mu_feature_debugger
351352
microsoft/mu_feature_dfci
@@ -354,6 +355,15 @@ group:
354355
microsoft/mu_oem_sample
355356
microsoft/mu_plus
356357
358+
# X64 architecture only
359+
- files:
360+
- source: .sync/workflows/leaf/codeql.yml
361+
dest: .github/workflows/codeql.yml
362+
template:
363+
archs: X64
364+
repos: |
365+
microsoft/mu_crypto_release
366+
357367
# Leaf Workflow - CodeQL - Platform
358368
# Note: This workflow should be used in repos that build firmware
359369
# packages from a platform builder (i.e. a PlatformBuild.py file).

.sync/workflows/leaf/codeql.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ jobs:
7272
7373
packages = [d for d in os.listdir() if d.strip().lower().endswith('pkg')]
7474
75-
# Ensure the package can actually be built for IA32 or X64
75+
# Ensure the package can actually be built for the target architectures
76+
archs = [a.strip() for a in '{% endraw %}{{ archs }}{% raw %}'.split(',')]
7677
for package in list(packages):
7778
dsc = [os.path.join(package, f) for f in os.listdir(package) if f.endswith('.dsc')]
78-
if not any('IA32' in l or 'X64' in l for d in dsc for l in open(d) if 'SUPPORTED_ARCHITECTURES' in l):
79+
if not any(arch in l for d in dsc for l in open(d) if 'SUPPORTED_ARCHITECTURES' in l for arch in archs):
7980
packages.remove(package)
8081
8182
packages.sort()
@@ -100,7 +101,8 @@ jobs:
100101
matrix:
101102
package: ${{ fromJson(needs.gather_packages.outputs.packages) }}
102103
include:
103-
- archs: IA32,X64
104+
- archs: {% endraw %}{{ archs }}{% raw %}
105+
104106
- tool_chain_tag: VS2022
105107

106108
steps:

0 commit comments

Comments
 (0)