Ci/fix ci errors #498
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: mocha-ios | |
| env: | |
| NO_FLIPPER: 1 | |
| on: | |
| pull_request: | |
| branches: | |
| - 'master' | |
| push: | |
| branches: | |
| - 'master' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| mocha-ios: | |
| runs-on: macos-13 | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Docker Colima | |
| run: | | |
| brew install docker docker-compose colima | |
| mkdir -p ~/.docker/cli-plugins | |
| ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose || true | |
| colima start --cpu 4 --memory 8 --disk 100 | |
| - name: Install backup-server dependencies | |
| working-directory: backup-server | |
| run: npm i || npm i | |
| - name: Run regtest setup | |
| working-directory: example/docker | |
| run: | | |
| mkdir lnd | |
| mkdir clightning | |
| chmod 777 lnd clightning | |
| docker compose up -d --quiet-pull | |
| - name: Wait for electrum server, LND and CLightning | |
| timeout-minutes: 5 | |
| run: | | |
| # Wait for Electrum | |
| while ! nc -z '127.0.0.1' 60001; do | |
| echo "Waiting for Electrum..." | |
| sleep 1 | |
| done | |
| echo "Electrum is ready!" | |
| # Wait for LND macaroon file | |
| cd example | |
| while [ ! -f docker/lnd/admin.macaroon ]; do | |
| echo "Waiting for LND macaroon..." | |
| sleep 2 | |
| done | |
| echo "LND macaroon found!" | |
| # Wait for CLightning to be ready | |
| while ! docker logs clightning 2>&1 | grep -q "Server started with public key"; do | |
| echo "Waiting for CLightning..." | |
| sleep 2 | |
| done | |
| echo "CLightning is ready!" | |
| echo "All services ready!" | |
| - name: Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' # cache packages, but not node_modules | |
| cache-dependency-path: 'example/yarn.lock' | |
| - name: Install lib dependencies | |
| working-directory: lib | |
| run: yarn || yarn | |
| - name: Build lib | |
| working-directory: lib | |
| run: yarn build | |
| - name: Install Dependencies | |
| working-directory: example | |
| run: (yarn || yarn) && yarn rn-setup | |
| - name: Cache Pods | |
| uses: actions/cache@v4 | |
| with: | |
| path: example/ios/Pods | |
| key: pods-${{ hashFiles('**/Podfile.lock') }} | |
| - name: Clean CocoaPods cache | |
| run: | | |
| rm -rf ~/Library/Caches/CocoaPods | |
| pod cache clean --all || true | |
| - name: Install pods | |
| working-directory: example | |
| env: | |
| COCOAPODS_DISABLE_CHECKSUM: true | |
| run: | | |
| gem update cocoapods xcodeproj | |
| pod install --project-directory=ios || pod install --project-directory=ios | |
| - name: Install applesimutils | |
| run: | | |
| brew tap wix/brew | |
| brew install applesimutils | |
| - name: Build | |
| working-directory: example | |
| run: npx react-native run-ios --no-packager --simulator='iPhone 15' | |
| - name: Test iOS app | |
| timeout-minutes: 30 | |
| working-directory: example | |
| run: yarn test:mocha:ios | |
| - name: Prepare articrafts | |
| # if: failure() | |
| run: | | |
| mkdir articrafts | |
| find /Users/runner/Library/Developer/CoreSimulator/Devices/ -path '*Documents/ldk' -exec cp -r "{}" articrafts/ \; | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: ldk-data | |
| path: articrafts |