creativecreatorormaybenot
Committed by GitHub

Fix iOS integration tests (#165)

* Replace instruments with xtrace

* Use `list devices`

* Include workflow file in paths

* Update devices

* Update awk command

* Use gawk for separation

* Debug

* Install gawk
... ... @@ -13,6 +13,7 @@ on:
- '**/test_driver/**'
- '**/assets/**'
- '**/integration_test/**'
- '.github/workflows/checks.yml'
jobs:
analyze:
... ... @@ -48,11 +49,12 @@ jobs:
test:
timeout-minutes: 16
runs-on: macos-latest
name: ${{ matrix.package }} testing on ${{ matrix.channel }}
name: ${{ matrix.package }} testing on ${{ matrix.channel }} with ${{ matrix.device }}
strategy:
matrix:
device:
- 'iPhone 12 Pro Max (14.4)'
- 'iPhone 12 Pro Simulator (15.0)'
- 'iPhone 13 Pro Max Simulator (15.0)'
channel:
- 'stable'
- 'beta'
... ... @@ -68,14 +70,15 @@ jobs:
steps:
- name: Start iOS simulator
if: matrix.package == 'wakelock'
# Using gawk to be able to use my regex to separate the IDs from the device names
# (because my awk skills suck) to then pipe that to awk to find the right device.
run: |
xcrun instruments -s
brew install gawk
xcrun xctrace list devices
UDID=$(
xcrun instruments -s |
awk \
-F ' *[][]' \
-v 'device=${{ matrix.device }}' \
'$1 == device { print $2 }'
xcrun xctrace list devices |
gawk 'match($0, /(.+) \(([^.]*)\)/, a) { printf "%s,%s\n", a[1], a[2] }' |
awk -F ',' -v 'device=${{ matrix.device }}' '$1 == device { print $2 }'
)
xcrun simctl boot "${UDID:?simulator not found}"
- uses: actions/checkout@v2.3.3
... ...