Skip to content

feat: readiness breakdown, metric explainers, layout fixes #67

feat: readiness breakdown, metric explainers, layout fixes

feat: readiness breakdown, metric explainers, layout fixes #67

Workflow file for this run

# CI Pipeline for Thump (HeartCoach)
# Builds iOS and watchOS targets and runs unit tests.
# Triggered on push to main and on pull requests.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: Build & Test
runs-on: macos-15
steps:
- uses: actions/checkout@v4
# ── Cache SPM packages ──────────────────────────────────
- name: Cache SPM packages
uses: actions/cache@v4
with:
path: |
~/Library/Developer/Xcode/DerivedData/**/SourcePackages
~/.build
key: spm-${{ runner.os }}-${{ hashFiles('apps/HeartCoach/Package.swift') }}
restore-keys: |
spm-${{ runner.os }}-
# ── Install tools ───────────────────────────────────────
- name: Install XcodeGen
run: brew install xcodegen
- name: Show Xcode version
run: xcodebuild -version
- name: List available simulators
run: xcrun simctl list devices available | grep -E "iPhone|Apple Watch" | head -10
- name: Generate Xcode Project
run: |
cd apps/HeartCoach
xcodegen generate
# ── Build iOS ───────────────────────────────────────────
- name: Build iOS
run: |
set -o pipefail
cd apps/HeartCoach
xcodebuild build \
-project Thump.xcodeproj \
-scheme Thump \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
-configuration Debug \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
2>&1 | tee /tmp/xcodebuild-ios.log | xcpretty
- name: Show Build Errors (if failed)
if: failure()
run: grep -A2 "error:" /tmp/xcodebuild-ios.log || echo "No error lines found"
# ── Build watchOS ───────────────────────────────────────
- name: Build watchOS
run: |
set -o pipefail
cd apps/HeartCoach
xcodebuild build \
-project Thump.xcodeproj \
-scheme ThumpWatch \
-destination 'platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)' \
-configuration Debug \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
2>&1 | tee /tmp/xcodebuild-watchos.log | xcpretty
- name: Show watchOS Build Errors (if failed)
if: failure()
run: grep -A2 "error:" /tmp/xcodebuild-watchos.log 2>/dev/null || echo "No watchOS error log"
# ── Run unit tests ──────────────────────────────────────
- name: Run Tests
run: |
set -o pipefail
cd apps/HeartCoach
xcodebuild test \
-project Thump.xcodeproj \
-scheme Thump \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
-enableCodeCoverage YES \
-resultBundlePath TestResults.xcresult \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
2>&1 | tee /tmp/xcodebuild-test.log | xcpretty
- name: Show Test Errors (if failed)
if: failure()
run: grep -A2 "error:" /tmp/xcodebuild-test.log 2>/dev/null || echo "No test error log"
# ── Coverage report ─────────────────────────────────────
- name: Extract Code Coverage
if: success()
run: |
cd apps/HeartCoach
xcrun xccov view --report TestResults.xcresult | head -30 >> "$GITHUB_STEP_SUMMARY"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: apps/HeartCoach/TestResults.xcresult
retention-days: 7