Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion .github/workflows/PackageMatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
runs-on: ubuntu-latest

outputs:
matrix: ${{ steps.filter-matrix.outputs.matrix || steps.set-packages.outputs.matrix }}
matrix: ${{ steps.clean-matrix.outputs.matrix }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -171,3 +171,50 @@ jobs:
echo "::endgroup::"
echo ""
echo "matrix=$OUTPUT" >> "$GITHUB_OUTPUT"

- name: Clean matrix if no packages found
id: clean-matrix
shell: bash
env:
MATRIX: ${{ steps.filter-matrix.outputs.matrix || steps.set-packages.outputs.matrix }}
DEFAULT_CONFIG: ${{ inputs.default-config }}
run: |
echo "Checking if matrix has any packages..."

# Check if packages array is empty
PACKAGES_COUNT=$(echo "$MATRIX" | jq '.packages | length')

echo "Packages count: $PACKAGES_COUNT"

if [ "$PACKAGES_COUNT" -eq 0 ]; then
echo "No packages found - removing default-config dimensions and packages, keeping include only"
# Keep only include, remove packages and all default-config dimensions
OUTPUT=$(echo "$MATRIX" | jq '{include: .include}')
else
echo "Packages found - keeping matrix as-is"
OUTPUT="$MATRIX"
fi

# Remove include if it's an empty array (regardless of packages count)
INCLUDE_COUNT=$(echo "$OUTPUT" | jq '.include | length')
echo "Include count: $INCLUDE_COUNT"

if [ "$INCLUDE_COUNT" -eq 0 ]; then
echo "Include array is empty - removing it"
OUTPUT=$(echo "$OUTPUT" | jq 'del(.include)')
fi

# Check if we have an empty JSON object and return empty string instead
OBJECT_KEYS=$(echo "$OUTPUT" | jq 'keys | length')
if [ "$OBJECT_KEYS" -eq 0 ]; then
echo "Matrix is completely empty - returning empty string"
OUTPUT=''
fi

echo "::group::Final matrix JSON"
echo "$OUTPUT" | jq .
echo "::endgroup::"
echo ""
# Ensure compact JSON output for GitHub Actions
COMPACT_OUTPUT=$(echo "$OUTPUT" | jq -c .)
echo "matrix=$COMPACT_OUTPUT" >> "$GITHUB_OUTPUT"
16 changes: 12 additions & 4 deletions .sync/Files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ group:
repos: |
microsoft/mu_crypto_release

# Leaf Workflow - CLANGPDB Package CI (feature repos)
# Leaf Workflow - CLANGPDB Package CI (mu_feature_config and mu_feature_dfci)
- files:
- source: .sync/workflows/leaf/clangpdb-ci.yml
dest: .github/workflows/clangpdb-ci.yml
Expand All @@ -655,19 +655,27 @@ group:
setup_cmd: both
repos: |
microsoft/mu_feature_config
microsoft/mu_feature_debugger
microsoft/mu_feature_dfci

# Leaf Workflow - CLANGPDB Package CI (mu_feature_ipmi and mu_feature_debugger)
- files:
- source: .sync/workflows/leaf/clangpdb-ci.yml
dest: .github/workflows/clangpdb-ci.yml
template:
branch: main
setup_cmd: ci-setup
repos: |
microsoft/mu_feature_ipmi
microsoft/mu_feature_debugger

# Leaf Workflow - CLANGPDB Package CI (mu_oem_sample, mu_plus)
# Leaf Workflow - CLANGPDB Package CI (mu_oem_sample)
- files:
- source: .sync/workflows/leaf/clangpdb-ci.yml
dest: .github/workflows/clangpdb-ci.yml
template:
setup_cmd: ci-setup
repos: |
microsoft/mu_oem_sample
microsoft/mu_plus

# Leaf Workflow - CLANGPDB Package CI (mu_tiano_platforms)
- files:
Expand Down
2 changes: 1 addition & 1 deletion .sync/Version.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#}

{# The git ref value that files dependent on this repo will use. #}
{% set mu_devops = "v18.0.4" %}
{% set mu_devops = "v18.0.5" %}

{# The latest Project Mu release branch value. #}
{% set latest_mu_release_branch = "release/202511" %}
Expand Down