diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82200a5..f52831a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,6 +216,65 @@ jobs: run: | ./scripts/test-ios.sh + test-ios-embedded: + runs-on: macos-latest + env: + TURBO_CACHE_DIR: .turbo/ios + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Turn on ios embedded + run: | + node ./scripts/turnOnIOSEmbedded.js + + - name: Setup + uses: ./.github/actions/setup + + - name: install bundler dependencies + run: | + cd example + bundle install + + - name: Cache turborepo for iOS + uses: actions/cache@v4 + with: + path: ${{ env.TURBO_CACHE_DIR }} + key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-turborepo-ios- + + - name: Check turborepo cache for iOS + run: | + TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:ios').cache.status") + + if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then + echo "turbo_cache_hit=1" >> $GITHUB_ENV + fi + + - name: Cache cocoapods + if: env.turbo_cache_hit != 1 + id: cocoapods-cache + uses: actions/cache@v4 + with: + path: | + **/ios/Pods + key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-cocoapods- + + - name: Install cocoapods + # if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' + run: | + cd example/ios + bundle exec pod install + env: + NO_FLIPPER: 1 + + - name: run tests + run: | + ./scripts/test-ios.sh + test-ios-sqlcipher: runs-on: macos-latest env: @@ -271,10 +330,6 @@ jobs: env: NO_FLIPPER: 1 - # - name: Build example for iOS - # run: | - # yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" - - name: run tests run: | ./scripts/test-ios.sh @@ -334,10 +389,6 @@ jobs: env: NO_FLIPPER: 1 - # - name: Build example for iOS - # run: | - # yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" - - name: run tests run: | ./scripts/test-ios.sh diff --git a/scripts/turnOnIOSEmbedded.js b/scripts/turnOnIOSEmbedded.js new file mode 100644 index 0000000..6fb74fe --- /dev/null +++ b/scripts/turnOnIOSEmbedded.js @@ -0,0 +1,21 @@ +const fs = require('fs'); + +// Read the package.json file +const packageJson = JSON.parse(fs.readFileSync('./example/package.json')); + +// Modify the op-sqlite.sqlcipher key to true +packageJson['op-sqlite']['iosSqlite'] = true; +packageJson['op-sqlite']['sqlcipher'] = false; +packageJson['op-sqlite']['crsqlite'] = false; +packageJson['op-sqlite']['libsql'] = false; +packageJson['op-sqlite']['sqliteVec'] = false; +packageJson['op-sqlite']['rtree'] = false; +packageJson['op-sqlite']['fts5'] = false; + +// Save the updated package.json file +fs.writeFileSync( + './example/package.json', + JSON.stringify(packageJson, null, 2) +); + +console.log('Turned on ios embedded in package.json', packageJson);