Skip to content

Commit

Permalink
ci(test): revert iOS tests
Browse files Browse the repository at this point in the history
runs are failing on CI both for make test and make test-ios. Will address in another PR
  • Loading branch information
ioannisj committed Nov 1, 2024
1 parent 56bbdc9 commit b705fdc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Tests
on:
push:
branches:
- main
pull_request:
paths-ignore:
- "**/*.md"
jobs:
test:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Test SDK
run: make test
- name: Test SDK (iOS)
run: make test-ios
name: Tests
on:
push:
branches:
- main
pull_request:
paths-ignore:
- "**/*.md"
jobs:
test:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Test SDK
run: make test
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SIMULATOR_IOS_VERSION= $(shell xcrun simctl list | grep ^iOS | ruby -e 'puts /\(([0-9.]+).*\)/.match(STDIN.read.chomp.split("\n").last).to_a[1]')
SIMULATOR_ID = $(call simulator_uuid_for,$(SIMULATOR_IOS_VERSION),iPhone \d\+) # skip Pro Max
SIMULATOR_IOS_VERSION = $(shell xcrun simctl list | grep ^iOS | ruby -e 'puts /\(([0-9.]+).*\)/.match(STDIN.read.chomp.split("\n").last).to_a[1]')
SIMULATOR_ID = $(call udid_for,$(SIMULATOR_IOS_VERSION),iPhone [0-9]+ [^M])
TEST_ITERATIONS = 1

.PHONY: build buildSdk buildExamples format swiftLint swiftFormat test testOniOSSimulator testOnMacSimulator lint bootstrap releaseCocoaPods
Expand Down Expand Up @@ -30,8 +30,8 @@ buildExamples:
format: swiftLint swiftFormat

print-env:
@echo "Simulator iOS version: $(SIMULATOR_IOS_VERSION)"
@echo "Simulator UUID: $(SIMULATOR_ID)"
@echo "Simulator iOS version: '$(SIMULATOR_IOS_VERSION)'"
@echo "Simulator UUID: '$(SIMULATOR_ID)'"

swiftLint:
swiftlint --fix
Expand Down Expand Up @@ -61,6 +61,13 @@ releaseCocoaPods:
pod trunk push PostHog.podspec --allow-warnings


define simulator_uuid_for
$(shell xcrun simctl list devices available 'iOS $(1)' | grep '$(2)' | sort -r | head -1 | awk -F '[()]' '{print $$(NF-3)}')
endef
define udid_for
$(shell xcrun simctl list --json devices available "$(1)" | jq -r --arg regex "$(2)" '
.devices
| to_entries
| map(select(.value | length > 0))
| map({key: .key, value: (.value | map(select(.name | test($$regex))))})
| map(select(.value | length > 0))
| .[0].value[0].udid
')
endef

0 comments on commit b705fdc

Please sign in to comment.