Support all address types #539
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: integration-tests | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| if: github.event.pull_request.draft == false | |
| name: Run Integration Tests | |
| runs-on: macos-15 | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '16.4' | |
| - name: Install xcbeautify | |
| run: | | |
| brew install xcbeautify | |
| - name: Cache Swift Package Manager | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/Library/Caches/org.swift.swiftpm | |
| ~/Library/org.swift.swiftpm | |
| Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm | |
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | |
| - name: Install dependencies | |
| run: | | |
| echo "⏱️ Starting dependency resolution at $(date)" | |
| xcodebuild -resolvePackageDependencies -onlyUsePackageVersionsFromResolvedFile | xcbeautify | |
| echo "✅ Dependencies resolved at $(date)" | |
| - name: Clean build | |
| run: | | |
| echo "⏱️ Cleaning build at $(date)" | |
| xcodebuild clean -scheme Bitkit | xcbeautify | |
| echo "✅ Build cleaned at $(date)" | |
| - name: Run integration tests | |
| run: | | |
| echo "⏱️ Starting integration tests at $(date)" | |
| run_tests() { | |
| set -o pipefail && xcodebuild test \ | |
| -scheme Bitkit \ | |
| -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \ | |
| -enableCodeCoverage NO \ | |
| -parallel-testing-enabled NO \ | |
| -only-testing:BitkitTests/UtxoSelectionTests \ | |
| -only-testing:BitkitTests/BlocktankTests \ | |
| -only-testing:BitkitTests/PaymentFlowTests \ | |
| -only-testing:BitkitTests/AddressTypeIntegrationTests \ | |
| | xcbeautify --report junit | |
| } | |
| # Try up to 3 times with simulator reset between failures | |
| for attempt in 1 2 3; do | |
| echo "🔄 Test attempt $attempt of 3" | |
| if run_tests; then | |
| echo "✅ Integration tests completed at $(date)" | |
| exit 0 | |
| fi | |
| if [ $attempt -lt 3 ]; then | |
| echo "⚠️ Test attempt $attempt failed, resetting simulator..." | |
| xcrun simctl shutdown all || true | |
| xcrun simctl erase "iPhone 16" || true | |
| xcrun simctl boot "iPhone 16" | |
| sleep 5 | |
| fi | |
| done | |
| echo "❌ All test attempts failed" | |
| exit 1 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: success() || failure() | |
| with: | |
| name: integration-test-results | |
| path: ~/Library/Developer/Xcode/DerivedData/**/Logs/Test/*.xcresult |