fix(ci): Force full test matrix on tag pushes
This commit is contained in:
parent
ba728c33ac
commit
8d26d5e699
1 changed files with 23 additions and 6 deletions
|
|
@ -4,10 +4,17 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Read changes from detect-changes output
|
# CRITICAL: Tags ALWAYS run full test matrix, no matter what
|
||||||
CHANGES=$(cat changes.json)
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
CHANGED_LANGS=$(echo "$CHANGES" | jq -r '.changed_langs[]' 2>/dev/null || echo "")
|
echo "Tag detected ($CI_COMMIT_TAG) - forcing full test matrix"
|
||||||
TEST_ALL=$(echo "$CHANGES" | jq -r '.test_all' 2>/dev/null || echo "false")
|
TEST_ALL="true"
|
||||||
|
CHANGED_LANGS=""
|
||||||
|
else
|
||||||
|
# Read changes from detect-changes output
|
||||||
|
CHANGES=$(cat changes.json)
|
||||||
|
CHANGED_LANGS=$(echo "$CHANGES" | jq -r '.changed_langs[]' 2>/dev/null || echo "")
|
||||||
|
TEST_ALL=$(echo "$CHANGES" | jq -r '.test_all' 2>/dev/null || echo "false")
|
||||||
|
fi
|
||||||
|
|
||||||
# Fetch ALL supported languages from the unsandbox API (the source of truth)
|
# Fetch ALL supported languages from the unsandbox API (the source of truth)
|
||||||
ALL_SDKS=$(curl -s "https://api.unsandbox.com/languages" | jq -r '.languages[]' | tr '\n' ' ')
|
ALL_SDKS=$(curl -s "https://api.unsandbox.com/languages" | jq -r '.languages[]' | tr '\n' ' ')
|
||||||
|
|
@ -53,6 +60,7 @@ cat > test-matrix.yml << 'EOF'
|
||||||
# Each test runs: build/un → unsandbox → SDK → unsandbox → test code
|
# Each test runs: build/un → unsandbox → SDK → unsandbox → test code
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -63,8 +71,19 @@ variables:
|
||||||
UNSANDBOX_PUBLIC_KEY: $UNSANDBOX_PUBLIC_KEY
|
UNSANDBOX_PUBLIC_KEY: $UNSANDBOX_PUBLIC_KEY
|
||||||
UNSANDBOX_SECRET_KEY: $UNSANDBOX_SECRET_KEY
|
UNSANDBOX_SECRET_KEY: $UNSANDBOX_SECRET_KEY
|
||||||
|
|
||||||
|
build-cli:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- bash scripts/build-clients.sh
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build/
|
||||||
|
expire_in: 1 hour
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
needs:
|
||||||
|
- build-cli
|
||||||
parallel:
|
parallel:
|
||||||
matrix:
|
matrix:
|
||||||
EOF
|
EOF
|
||||||
|
|
@ -76,8 +95,6 @@ done
|
||||||
|
|
||||||
# Complete the test job template
|
# Complete the test job template
|
||||||
cat >> test-matrix.yml << 'EOF'
|
cat >> test-matrix.yml << 'EOF'
|
||||||
before_script:
|
|
||||||
- bash scripts/build-clients.sh
|
|
||||||
script:
|
script:
|
||||||
- bash scripts/test-sdk.sh "$SDK_LANG"
|
- bash scripts/test-sdk.sh "$SDK_LANG"
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue