Skip to content

Commit

Permalink
ci: run the iOS apps in ci (#202)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Nino jnino@lyft.com

Description: previously the CI runs would only build the demos. However we did not run them, or check for liveliness. This is a first iteration of doing so for iOS.
Risk Level: low - improved CI
Testing: tested locally and on CI

Part of #117

Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
junr03 authored and jpsim committed Nov 28, 2022
1 parent 9977f86 commit e80040f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions mobile/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@ stages:
targetPath: dist/Envoy.framework
- script: bazel build --config=ios //examples/objective-c/hello_world:app
displayName: 'Build objective-c app'
# Now check that the app actually runs on the simulator.
# This is a non-ideal way to check for liveliness, but works for now.
# First start the iOS simulator.
# Interestingly bazel run does not start the simulator in CI.
# https://github.com/lyft/envoy-mobile/issues/201 for further investigation.
- script: npm install -g ios-sim && ios-sim start --devicetypeid "iPhone-X, 12.2"
displayName: 'Start the iOS simulator'
# Run the app in the background and redirect logs.
- script: bazel run --config=ios //examples/objective-c/hello_world:app &> /tmp/envoy.log &
displayName: 'Run objective-c app'
# Wait for the app to start and get some requests/responses.
- script: sleep 60
displayName: 'Sleep'
# Check for the sentinel value that shows the app is alive and well.
- script: cat /tmp/envoy.log | grep 'Hello, world!'
displayName: 'Check liveliness'
- job: mac_swift_helloworld
dependsOn: mac_dist
timeoutInMinutes: 60
Expand All @@ -227,3 +243,19 @@ stages:
targetPath: dist/Envoy.framework
- script: bazel build --config=ios //examples/swift/hello_world:app
displayName: 'Build swift app'
# Now check that the app actually runs on the simulator.
# This is a non-ideal way to check for liveliness, but works for now.
# First start the iOS simulator.
# Interestingly bazel run does not start the simulator in CI.
# https://github.com/lyft/envoy-mobile/issues/201 for further investigation.
- script: npm install -g ios-sim && ios-sim start --devicetypeid "iPhone-X, 12.2"
displayName: 'Start the iOS simulator'
# Run the app in the background and redirect logs.
- script: bazel run --config=ios //examples/swift/hello_world:app &> /tmp/envoy.log &
displayName: 'Run swift app'
# Wait for the app to start and get some requests/responses.
- script: sleep 60
displayName: 'Sleep'
# Check for the sentinel value that shows the app is alive and well.
- script: cat /tmp/envoy.log | grep 'Hello, world!'
displayName: 'Check liveliness'

0 comments on commit e80040f

Please sign in to comment.