Skip to content

Commit

Permalink
Turn on iOS embedded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Dec 22, 2024
1 parent 6b6790f commit 3424edd
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 8 deletions.
67 changes: 59 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions scripts/turnOnIOSEmbedded.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 3424edd

Please sign in to comment.