Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug fixes

bug fixes #183

Workflow file for this run

name: Test Suite
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ main ]
paths:
- '**.swift'
- '**.xcodeproj/**'
- '**.xcworkspace/**'
- '.github/workflows/tests.yml'
pull_request:
branches: [ main ]
paths:
- '**.swift'
- '**.xcodeproj/**'
- '**.xcworkspace/**'
- '.github/workflows/tests.yml'
workflow_dispatch:
jobs:
macos_unit_tests:
name: macOS Unit Tests
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- macos-version: macos-14
xcode-path: /Applications/Xcode_16.2.app/Contents/Developer
- macos-version: macos-15
xcode-path: /Applications/Xcode_16.4.app/Contents/Developer
- macos-version: macos-26
xcode-path: /Applications/Xcode_26.0.app/Contents/Developer
runs-on: ${{ matrix.macos-version }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Select Xcode version
run: sudo xcode-select -s ${{ matrix.xcode-path }}
- name: Show Xcode version
run: xcodebuild -version
- name: Run unit tests
run: |
set -o pipefail
xcodebuild \
-project Ayna.xcodeproj \
-scheme Ayna \
-destination 'platform=macOS' \
-derivedDataPath ./build \
-only-testing:aynaTests \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
test
macos_ui_tests:
name: macOS UI Tests
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- macos-version: macos-14
xcode-path: /Applications/Xcode_16.2.app/Contents/Developer
- macos-version: macos-15
xcode-path: /Applications/Xcode_16.4.app/Contents/Developer
- macos-version: macos-26
xcode-path: /Applications/Xcode_26.0.app/Contents/Developer
runs-on: ${{ matrix.macos-version }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Select Xcode version
run: sudo xcode-select -s ${{ matrix.xcode-path }}
- name: Show Xcode version
run: xcodebuild -version
- name: Run UI tests (with retry)
run: |
set -o pipefail
# UI tests can be flaky in CI - retry up to 2 times
for attempt in 1 2; do
echo "Attempt $attempt of 2"
if xcodebuild \
-project Ayna.xcodeproj \
-scheme Ayna \
-destination 'platform=macOS' \
-derivedDataPath ./build \
-resultBundlePath ./build/TestResults-macOS-UI-$attempt.xcresult \
-only-testing:aynaUITests \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=YES \
-retry-tests-on-failure \
test; then
echo "Tests passed on attempt $attempt"
exit 0
fi
if [ $attempt -lt 2 ]; then
echo "Tests failed, retrying..."
sleep 5
fi
done
echo "Tests failed after 2 attempts"
exit 1
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v6
with:
name: macOS-UI-TestResults-${{ matrix.macos-version }}
path: ./build/*.xcresult
retention-days: 7
ios_unit_tests:
name: iOS Unit Tests
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- macos-version: macos-15
xcode-path: /Applications/Xcode_16.4.app/Contents/Developer
destination: 'platform=iOS Simulator,name=iPhone 16 Pro Max'
- macos-version: macos-26
xcode-path: /Applications/Xcode_26.0.app/Contents/Developer
destination: 'platform=iOS Simulator,name=iPhone 17'
runs-on: ${{ matrix.macos-version }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Select Xcode version
run: sudo xcode-select -s ${{ matrix.xcode-path }}
- name: Show Xcode version
run: xcodebuild -version
- name: List available simulators
run: |
echo "Available iOS runtimes:"
xcrun simctl list runtimes | grep -i ios || true
echo "Available iOS devices:"
xcrun simctl list devices available | grep -i iphone | head -20 || true
- name: Boot iOS Simulator
run: |
# Pre-boot simulator for more reliable tests
DEVICE_NAME=$(echo '${{ matrix.destination }}' | sed -n 's/.*name=\([^,]*\).*/\1/p')
DEVICE_UDID=$(xcrun simctl list devices available | grep "$DEVICE_NAME" | head -1 | grep -oE '[A-F0-9-]{36}')
if [ -n "$DEVICE_UDID" ]; then
echo "Booting simulator: $DEVICE_NAME ($DEVICE_UDID)"
xcrun simctl boot "$DEVICE_UDID" 2>/dev/null || true
# Wait for boot to complete
sleep 5
fi
- name: Run iOS unit tests
run: |
set -o pipefail
xcodebuild \
-project Ayna.xcodeproj \
-scheme Ayna-iOS \
-destination '${{ matrix.destination }}' \
-derivedDataPath ./build \
-only-testing:Ayna-iOSTests \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
test
ios_ui_tests:
name: iOS UI Tests
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- macos-version: macos-15
xcode-path: /Applications/Xcode_16.4.app/Contents/Developer
destination: 'platform=iOS Simulator,name=iPhone 16 Pro Max'
- macos-version: macos-26
xcode-path: /Applications/Xcode_26.0.app/Contents/Developer
destination: 'platform=iOS Simulator,name=iPhone 17'
runs-on: ${{ matrix.macos-version }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Select Xcode version
run: sudo xcode-select -s ${{ matrix.xcode-path }}
- name: Show Xcode version
run: xcodebuild -version
- name: List available simulators
run: |
echo "Available iOS runtimes:"
xcrun simctl list runtimes | grep -i ios || true
echo "Available iOS devices:"
xcrun simctl list devices available | grep -i iphone | head -20 || true
- name: Boot iOS Simulator
run: |
# Pre-boot simulator for more reliable tests
DEVICE_NAME=$(echo '${{ matrix.destination }}' | sed -n 's/.*name=\([^,]*\).*/\1/p')
DEVICE_UDID=$(xcrun simctl list devices available | grep "$DEVICE_NAME" | head -1 | grep -oE '[A-F0-9-]{36}')
if [ -n "$DEVICE_UDID" ]; then
echo "Booting simulator: $DEVICE_NAME ($DEVICE_UDID)"
xcrun simctl boot "$DEVICE_UDID" 2>/dev/null || true
# Wait for boot to complete
sleep 5
fi
- name: Run iOS UI tests (with retry)
run: |
set -o pipefail
# UI tests can be flaky in CI - retry up to 2 times
for attempt in 1 2; do
echo "Attempt $attempt of 2"
if xcodebuild \
-project Ayna.xcodeproj \
-scheme Ayna-iOS \
-destination '${{ matrix.destination }}' \
-derivedDataPath ./build \
-resultBundlePath ./build/TestResults-iOS-UI-$attempt.xcresult \
-only-testing:Ayna-iOSUITests \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=YES \
-retry-tests-on-failure \
test; then
echo "Tests passed on attempt $attempt"
exit 0
fi
if [ $attempt -lt 2 ]; then
echo "Tests failed, retrying..."
sleep 5
fi
done
echo "Tests failed after 2 attempts"
exit 1
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v6
with:
name: iOS-UI-TestResults-${{ matrix.macos-version }}
path: ./build/*.xcresult
retention-days: 7
watchos_unit_tests:
name: watchOS Unit Tests
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- macos-version: macos-15
xcode-path: /Applications/Xcode_16.4.app/Contents/Developer
destination: 'platform=watchOS Simulator,name=Apple Watch Ultra 2 (49mm)'
- macos-version: macos-26
xcode-path: /Applications/Xcode_26.0.app/Contents/Developer
destination: 'platform=watchOS Simulator,name=Apple Watch Ultra 3 (49mm)'
runs-on: ${{ matrix.macos-version }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Select Xcode version
run: sudo xcode-select -s ${{ matrix.xcode-path }}
- name: Show Xcode version
run: xcodebuild -version
- name: List available simulators
run: |
echo "Available watchOS runtimes:"
xcrun simctl list runtimes | grep -i watchos || true
echo "Available watchOS devices:"
xcrun simctl list devices available | grep -i watch | head -20 || true
- name: Boot watchOS Simulator
run: |
# Pre-boot simulator for more reliable tests
DEVICE_NAME=$(echo '${{ matrix.destination }}' | sed -n 's/.*name=\([^)]*\).*/\1/p')
DEVICE_UDID=$(xcrun simctl list devices available | grep "$DEVICE_NAME" | head -1 | grep -oE '[A-F0-9-]{36}')
if [ -n "$DEVICE_UDID" ]; then
echo "Booting simulator: $DEVICE_NAME ($DEVICE_UDID)"
xcrun simctl boot "$DEVICE_UDID" 2>/dev/null || true
# Wait for boot to complete
sleep 5
fi
- name: Run watchOS unit tests
run: |
set -o pipefail
xcodebuild \
-project Ayna.xcodeproj \
-scheme 'Ayna-watchOS Watch App' \
-destination '${{ matrix.destination }}' \
-derivedDataPath ./build \
-only-testing:Ayna-watchOSTests \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
test
watchos_ui_tests:
name: watchOS UI Tests
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- macos-version: macos-15
xcode-path: /Applications/Xcode_16.4.app/Contents/Developer
destination: 'platform=watchOS Simulator,name=Apple Watch Ultra 2 (49mm)'
- macos-version: macos-26
xcode-path: /Applications/Xcode_26.0.app/Contents/Developer
destination: 'platform=watchOS Simulator,name=Apple Watch Ultra 3 (49mm)'
runs-on: ${{ matrix.macos-version }}
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Select Xcode version
run: sudo xcode-select -s ${{ matrix.xcode-path }}
- name: Show Xcode version
run: xcodebuild -version
- name: List available simulators
run: |
echo "Available watchOS runtimes:"
xcrun simctl list runtimes | grep -i watchos || true
echo "Available watchOS devices:"
xcrun simctl list devices available | grep -i watch | head -20 || true
- name: Boot watchOS Simulator
run: |
# Pre-boot simulator for more reliable tests
DEVICE_NAME=$(echo '${{ matrix.destination }}' | sed -n 's/.*name=\([^)]*\).*/\1/p')
DEVICE_UDID=$(xcrun simctl list devices available | grep "$DEVICE_NAME" | head -1 | grep -oE '[A-F0-9-]{36}')
if [ -n "$DEVICE_UDID" ]; then
echo "Booting simulator: $DEVICE_NAME ($DEVICE_UDID)"
xcrun simctl boot "$DEVICE_UDID" 2>/dev/null || true
# Wait for boot to complete
sleep 5
fi
- name: Run watchOS UI tests (with retry)
run: |
set -o pipefail
# UI tests can be flaky in CI - retry up to 2 times
for attempt in 1 2; do
echo "Attempt $attempt of 2"
if xcodebuild \
-project Ayna.xcodeproj \
-scheme 'Ayna-watchOS Watch App' \
-destination '${{ matrix.destination }}' \
-derivedDataPath ./build \
-resultBundlePath ./build/TestResults-watchOS-UI-$attempt.xcresult \
-only-testing:Ayna-watchOSUITests \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=YES \
-retry-tests-on-failure \
test; then
echo "Tests passed on attempt $attempt"
exit 0
fi
if [ $attempt -lt 2 ]; then
echo "Tests failed, retrying..."
sleep 5
fi
done
echo "Tests failed after 2 attempts"
exit 1
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v6
with:
name: watchOS-UI-TestResults-${{ matrix.macos-version }}
path: ./build/*.xcresult
retention-days: 7