Skip to content

Update README.md and STBaseProject.podspec for versioning and badge i… #5

Update README.md and STBaseProject.podspec for versioning and badge i…

Update README.md and STBaseProject.podspec for versioning and badge i… #5

Workflow file for this run

# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: xcodebuild -scheme STBaseProject-Package -destination 'generic/platform=iOS Simulator' build
- name: Build For Testing
run: xcodebuild -scheme STBaseProject-Package -destination 'generic/platform=iOS Simulator' build-for-testing
- name: Run Tests Without Building
shell: bash
run: |
set -euo pipefail
DESTINATIONS="$(xcodebuild -scheme STBaseProject-Package -showdestinations 2>/dev/null)"
SIMULATOR_ID="$(printf '%s\n' "$DESTINATIONS" | awk '/platform:iOS Simulator/ && /OS:/ { if (match($0, /id:[^,}]+/)) { value = substr($0, RSTART + 3, RLENGTH - 3); gsub(/[[:space:]]/, "", value); print value; exit } }')"
if [ -z "${SIMULATOR_ID:-}" ]; then
echo "No available iOS Simulator destination found."
echo "Full xcodebuild -showdestinations output:"
printf '%s\n' "$DESTINATIONS"
exit 1
fi
echo "Using iOS Simulator id: $SIMULATOR_ID"
xcodebuild -scheme STBaseProject-Package -destination "id=$SIMULATOR_ID" test-without-building