Skip to content

Imageassets

Imageassets #26

Workflow file for this run

name: Craftify iOS CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-and-test:
name: Build and Test Craftify on iPhone 15 Simulator (iOS 17.0)
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select Xcode Version
run: |
# List available Xcode installations
ls -ld /Applications/Xcode*.app
# Try common Xcode paths
XCODE_PATH=$(find /Applications -maxdepth 1 -name "Xcode*.app" | head -n 1)
if [ -z "$XCODE_PATH" ]; then
echo "No Xcode installation found"
exit 1
fi
sudo xcode-select -s "$XCODE_PATH/Contents/Developer"
xcodebuild -version
echo "Selected Xcode at $XCODE_PATH"
- name: Build
env:
SCHEME: Craftify
PLATFORM: iOS Simulator
DESTINATION: platform=iOS Simulator,name=iPhone 15,OS=17.0
run: |
xcodebuild clean build-for-testing \
-scheme "$SCHEME" \
-project "Craftify.xcodeproj" \
-destination "$DESTINATION" \
CODE_SIGNING_ALLOWED=NO | xcpretty
echo "Build completed successfully"
- name: Test
env:
SCHEME: Craftify
PLATFORM: iOS Simulator
DESTINATION: platform=iOS Simulator,name=iPhone 15,OS=17.0
run: |
xcodebuild test \
-scheme "$SCHEME" \
-project "Craftify.xcodeproj" \
-destination "$DESTINATION" \
-enableSwiftTesting \
-testProductsPath "CraftifyTests" \
-testProductsPath "CraftifyUITests" \
-enableCodeCoverage YES \
CODE_SIGNING_ALLOWED=NO | xcpretty
echo "Tests completed successfully"
- name: Archive Code Coverage
if: always()
run: |
xcrun xccov view --report --only-covered-files \
$(find DerivedData -name "*.xcresult" -type d) \
> coverage.txt
echo "Coverage report generated"
continue-on-error: true
- name: Upload Coverage Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage.txt