Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,21 @@ jobs:
run: |
swift format lint -r -s ./interop/src/clients/InteropClient
swiftlint --strict ./interop/src/clients/InteropClient
- name: Create simulator
run: |
echo "SIMULATOR=$(sh ./scripts/create-ios-sim-device.sh "iPhone 16 test-ios")" >> $GITHUB_ENV

- name: ios tests
run: |
cd crypto-ffi/bindings/swift/WireCoreCrypto

# run tests
xcodebuild test -scheme TestHost -configuration Release -sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16'
-destination 'platform=iOS Simulator,name=iPhone 16 test-ios'
- name: Delete simulator
if: always()
run: |
./scripts/delete-ios-sim-device.sh ${{ env.SIMULATOR }}

test-android:
if: github.repository == 'wireapp/core-crypto' && github.event_name == 'pull_request'
Expand Down Expand Up @@ -317,19 +327,22 @@ jobs:
with:
name: ${{github.event.number}}-swift-ffi
path: crypto-ffi/bindings/swift/WireCoreCryptoUniffi
- name: create simulator
run: |
echo "SIMULATOR=$(./scripts/create-ios-sim-device.sh "iPhone 16 e2e-interop-test")" >> $GITHUB_ENV
- name: build & install iOS Interop client
run: |
cd interop/src/clients/InteropClient
xcodebuild -scheme InteropClient -sdk iphonesimulator -configuration Release \
-destination 'platform=iOS Simulator,name=iPhone 16' clean build install DSTROOT=./Products
echo "INTEROP_SIMULATOR_DEVICE=$(./create_simulator.sh)" >> $GITHUB_ENV
-destination 'platform=iOS Simulator,name=iPhone 16 e2e-interop-test' clean build install DSTROOT=./Products
./install-interop-client.sh ${{ env.SIMULATOR }}
- name: run e2e interop test
run: cargo run --bin interop
# we separate shutdown from deletion to make sure the device is always removed, even when shutdown failed
- name: delete simulator
if: always()
run: |
cd interop/src/clients/InteropClient
./delete_simulator.sh ${{ env.INTEROP_SIMULATOR_DEVICE }}
./scripts/delete-ios-sim-device.sh ${{ env.SIMULATOR }}

build-and-test-wasm:
if: github.event_name == 'pull_request'
Expand Down
9 changes: 0 additions & 9 deletions interop/src/clients/InteropClient/delete_simulator.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
# Fail on first error
set -e

SIMULATOR_NAME="Interop Simulator - `uuidgen`"
SIMULATOR_UDID=`xcrun simctl create "$SIMULATOR_NAME" "iPhone 16"`
echo "Creating new simulator" >&2
SIMULATOR_UDID="$1"
echo "Booting simulator" >&2
xcrun simctl boot $SIMULATOR_UDID
echo "Installing application" >&2
xcrun simctl install $SIMULATOR_UDID Products/Applications/InteropClient.app
Expand Down
9 changes: 9 additions & 0 deletions scripts/create-ios-sim-device.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

NAME="$1"

UDID=$(xcrun simctl create "$NAME" \
com.apple.CoreSimulator.SimDeviceType.iPhone-16 \
com.apple.CoreSimulator.SimRuntime.iOS-18-6)

echo "$UDID"
10 changes: 10 additions & 0 deletions scripts/delete-ios-sim-device.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

UDID="$1"

# Delete the simulator
xcrun simctl delete "$UDID"

# Clean up logs and device data
rm -rf ~/Library/Logs/CoreSimulator/"$UDID"
rm -rf ~/Library/Developer/CoreSimulator/Devices/"$UDID"
Loading