Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
65094c8
Run the Python variant of web-app-cosmosdb-nosql-api in the samples CI
paolosalvatori Oct 23, 2026
ea91bb3
Run the scripts from Git Bash and MSYS2 with MSYS_NO_PATHCONV=1
paolosalvatori Oct 23, 2026
299aec8
Hand zip a Windows path for the archives the Event Hubs scripts build
paolosalvatori Oct 23, 2026
fbf1f3f
Run a few samples on a Windows runner from Git Bash
paolosalvatori Oct 23, 2026
3d63d51
Remove the empty file whose name breaks checkouts on Windows
paolosalvatori Oct 23, 2026
7f0c2f7
Merge the fix branch, which removes the file Windows cannot check out
paolosalvatori Oct 23, 2026
6cf3220
Start the Windows job's Docker Engine on TCP after stopping the packa…
paolosalvatori Oct 23, 2026
7d43db9
Run every sample in the Windows job
paolosalvatori Oct 23, 2026
6d0b221
Discard curl's responses through the NUL device in Git Bash and MSYS2
paolosalvatori Oct 23, 2026
850bb1f
Run Maven with the path conversion back on in the Service Bus sample
paolosalvatori Oct 23, 2026
6b31724
Merge the fix branch: null device for curl, Maven with the conversion on
paolosalvatori Oct 23, 2026
113c982
Print Maven's version with the path conversion on, as the Service Bus…
paolosalvatori Oct 23, 2026
2f9748c
Tell Git Bash and MSYS2 users to drop the carriage returns of Windows…
paolosalvatori Oct 23, 2026
e0f8dbb
Merge the fix branch: carriage returns in the README
paolosalvatori Oct 23, 2026
bf49df6
Drop the carriage returns of Windows programs in the Windows job, as …
paolosalvatori Oct 23, 2026
8baf8fc
Strip the carriage return of the Azure CLI from the arrays mapfile fills
paolosalvatori Oct 23, 2026
d8b89b9
Merge the fix branch: carriage returns in mapfile
paolosalvatori Oct 23, 2026
3ed7db1
Turn off WSL's DNS tunneling in the Windows job
paolosalvatori Oct 23, 2026
8d3f85c
Skip the SQL Database certificate check where the container IP is unr…
paolosalvatori Oct 23, 2026
5f79307
Merge the fix branch: SQL Database certificate check
paolosalvatori Oct 23, 2026
793fdae
Merge main into windows-git-bash-samples-ci
paolosalvatori Oct 26, 2026
125a134
Run the Bicep and Terraform variants of the custom-image web app samp…
paolosalvatori Oct 26, 2026
a14d69c
Choose Linux, Windows or both with a platform dropdown, as entries of…
paolosalvatori Oct 26, 2026
4b36a9c
Run the custom-image Terraform sample's push script with bash, so it …
paolosalvatori Oct 26, 2026
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
58 changes: 41 additions & 17 deletions .github/scripts/build-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
set -euo pipefail

# Builds a dynamic GitHub Actions matrix for run-samples.yml.
# Usage: build-matrix.sh <run_mode> [base_sha] [arch_filter]
# Usage: build-matrix.sh <run_mode> [base_sha] [arch_filter] [platform]

# "all" runs every test; "changed" only runs tests whose watch_folders have modified files
RUN_MODE="${1:-all}"
BASE_SHA="${2:-}"
# "both" runs each test on every architecture it supports; "amd64"/"arm64" restrict it to one
# "both" runs each test on every architecture it supports; "amd64"/"arm64" restrict it to one. It applies to
# the Linux entries: the Windows runner is amd64, so a Windows entry always runs on amd64
ARCH_FILTER="${3:-both}"
case "$ARCH_FILTER" in
both | amd64 | arm64) ;;
*) echo "Invalid arch filter: '$ARCH_FILTER' (expected both, amd64 or arm64)" >&2; exit 1 ;;
esac
# "Linux" or "Windows" picks the runners the tests run on, "all" both: one entry per test and platform
PLATFORM="${4:-Linux}"
case "$PLATFORM" in
Linux | Windows | all) ;;
*) echo "Invalid platform: '$PLATFORM' (expected Linux, Windows or all)" >&2; exit 1 ;;
esac

# Get JSON metadata for all tests from run-samples.sh --list
TEST_META=$(./run-samples.sh --list)
TOTAL=$(echo "$TEST_META" | jq length)
echo "Run mode: $RUN_MODE | Arch filter: $ARCH_FILTER | Total tests: $TOTAL"
echo "Run mode: $RUN_MODE | Arch filter: $ARCH_FILTER | Platform: $PLATFORM | Total tests: $TOTAL"

# Changes to these files affect all tests, so any modification triggers a full run
INFRA_FILES="run-samples.sh Makefile .github/workflows/run-samples.yml .github/scripts/build-matrix.sh pyproject.toml requirements-dev.txt requirements-runtime.txt"
Expand Down Expand Up @@ -62,23 +69,40 @@ if [[ -z "${INDICES:-}" ]]; then
MATRIX='{"include":[]}'
else
# Convert space-separated indices to JSON array, then build the matrix object.
# Each selected test is expanded into one entry per architecture it supports, so a
# Each selected test is expanded into one Linux entry per architecture it supports, so a
# test that runs on both arches becomes two independent jobs. Tests that declare only
# amd64 depend on an amd64-only container image — see run-samples.sh for the details.
# A Windows entry runs the test from Git Bash on the amd64 Windows runner: every test
# declares amd64, so each selected test gets one.
IDX_JSON=$(echo "$INDICES" | tr ' ' '\n' | jq -R 'tonumber' | jq -s '.')
MATRIX=$(echo "$TEST_META" | jq -c --argjson idx "$IDX_JSON" --arg filter "$ARCH_FILTER" \
'{include: [
$idx[] as $i | .[$i] as $test |
$test.arches[] |
select($filter == "both" or . == $filter) |
{
shard: $test.shard,
splits: $test.splits,
arch: .,
runner: (if . == "arm64" then "ubuntu-22.04-arm" else "ubuntu-22.04" end),
name: ($test.name + " [" + . + "]")
}
]}')
MATRIX=$(echo "$TEST_META" | jq -c --argjson idx "$IDX_JSON" --arg filter "$ARCH_FILTER" --arg platform "$PLATFORM" \
'{include: (
(if $platform == "Windows" then [] else [
$idx[] as $i | .[$i] as $test |
$test.arches[] |
select($filter == "both" or . == $filter) |
{
shard: $test.shard,
splits: $test.splits,
arch: .,
os: "linux",
runner: (if . == "arm64" then "ubuntu-22.04-arm" else "ubuntu-22.04" end),
name: ($test.name + " [" + . + "]")
}
] end)
+ (if $platform == "Linux" then [] else [
$idx[] as $i | .[$i] as $test |
select($test.arches | index("amd64")) |
{
shard: $test.shard,
splits: $test.splits,
arch: "amd64",
os: "windows",
runner: "windows-latest",
name: ($test.name + " [Windows]")
}
] end)
)}')
fi

# An arch filter can select tests that support no matching architecture, so decide
Expand Down
Loading
Loading