Skip to content

Commit

Permalink
ci: replace GHA with buildkite for unit test runs and release validat…
Browse files Browse the repository at this point in the history
…ion (#117)
  • Loading branch information
andrewjl-mux authored Nov 27, 2024
1 parent e5beb19 commit c3e3bd8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 42 deletions.
9 changes: 9 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
agents:
queue: "macOS-Monterey-12-4"

steps:
- command: "./scripts/run-unit-tests.sh MuxUploadSDK"
label: ":xcode_simulator: Unit Tests"
- wait
- command: "./scripts/version-check.sh"
label: ":clipboard: Version Check"
16 changes: 0 additions & 16 deletions .github/workflows/run-tests.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/validate-release.yml

This file was deleted.

6 changes: 1 addition & 5 deletions scripts/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ then
exit 1
fi

echo "▸ Selecting Xcode 15.4"

sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer

echo "▸ Using Xcode Version: ${XCODE}"

echo "▸ Available Xcode SDKs"
Expand All @@ -40,5 +36,5 @@ echo "▸ Test ${SCHEME}"
xcodebuild clean test \
-scheme $SCHEME \
-destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' \
-sdk iphonesimulator17.5 \
-sdk iphonesimulator18.0 \
| xcbeautify
20 changes: 16 additions & 4 deletions scripts/version-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@ cocoapod_spec_version=$(grep -Eo '\b[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+)?(\+[0

echo "Detected Cocoapod Spec Version: ${cocoapod_spec_version}"

# Checks branch name for a v followed by a semantic version MAJOR.MINOR.PATCH string
release_version=$(git branch --show-current | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
SEMANTIC_VERSION_FILE=Sources/MuxUploadSDK/PublicAPI/SemanticVersion.swift

echo "Inferred Release Version: ${release_version}"
release_version=$(awk '
/let major/ { gsub(/[^0-9]/, "", $0); major = $0 }
/let minor/ { gsub(/[^0-9]/, "", $0); minor = $0 }
/let patch/ { gsub(/[^0-9]/, "", $0); patch = $0 }
END {
if (major && minor && patch) {
print major "." minor "." patch
} else {
print "Error: Version information not found"
}
}
' <(grep -E 'let major|let minor|let patch' "$SEMANTIC_VERSION_FILE"))

echo "Release version found in ${SEMANTIC_VERSION_FILE}: ${release_version}"

if [ "${cocoapod_spec_version}" == "${release_version}" ]; then
echo "Versions match"
else
echo "Versions do not match, please update ${COCOAPOD_SPEC} to ${release_version}"
echo "Versions do not match, please fix up ${COCOAPOD_SPEC} or ${release_version} to be consistent"
exit 1
fi

0 comments on commit c3e3bd8

Please sign in to comment.