Skip to content

Commit 53b29ac

Browse files
authored
impr(ci): use brew bundle to install dependencies, and split test/dep… (#4816)
1 parent ea54375 commit 53b29ac

9 files changed

Lines changed: 28 additions & 22 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213
- uses: actions/checkout@v4
214214
- name: Build for Debug
215215
run: |
216-
./scripts/xcode-test.sh \
216+
./scripts/sentry-xcodebuild.sh \
217217
--platform iOS \
218218
--os latest \
219219
--ref ${{ github.ref }} \
@@ -231,7 +231,7 @@ jobs:
231231
- uses: actions/checkout@v4
232232
- name: Build for Release
233233
run: |
234-
./scripts/xcode-test.sh \
234+
./scripts/sentry-xcodebuild.sh \
235235
--platform iOS \
236236
--os latest \
237237
--ref ${{ github.ref }} \
@@ -249,7 +249,7 @@ jobs:
249249
- uses: actions/checkout@v4
250250
- name: Build for Debug
251251
run: |
252-
./scripts/xcode-test.sh \
252+
./scripts/sentry-xcodebuild.sh \
253253
--platform iOS \
254254
--os latest \
255255
--ref ${{ github.ref }} \
@@ -267,7 +267,7 @@ jobs:
267267
- uses: actions/checkout@v4
268268
- name: Build for Release
269269
run: |
270-
./scripts/xcode-test.sh \
270+
./scripts/sentry-xcodebuild.sh \
271271
--platform iOS \
272272
--os latest \
273273
--ref ${{ github.ref }} \

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
- "fastlane/**"
1616
- "scripts/tests-with-thread-sanitizer.sh"
1717
- "scripts/ci-select-xcode.sh"
18-
- "scripts/xcode-test.sh"
18+
- "scripts/sentry-xcodebuild.sh"
1919
- ".codecov.yml"
2020
- Sentry.xcodeproj
2121

@@ -186,7 +186,7 @@ jobs:
186186
- name: Build tests
187187
id: build_tests
188188
run: |
189-
./scripts/xcode-test.sh \
189+
./scripts/sentry-xcodebuild.sh \
190190
--platform ${{matrix.platform}} \
191191
--os ${{matrix.test-destination-os}} \
192192
--ref ${{ github.ref_name }} \
@@ -201,7 +201,7 @@ jobs:
201201
# because GitHub Actions don't provide an easy way of
202202
# manipulating string in expressions.
203203
run: |
204-
./scripts/xcode-test.sh \
204+
./scripts/sentry-xcodebuild.sh \
205205
--platform ${{matrix.platform}} \
206206
--os ${{matrix.test-destination-os}} \
207207
--ref ${{ github.ref_name }} \

.github/workflows/ui-tests-critical.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ jobs:
6767
- uses: actions/checkout@v4
6868
- name: Create ${{matrix.device}} (${{matrix.os-version}}) Simulator using Xcode ${{matrix.xcode}}
6969
run: ./scripts/create-simulator.sh "${{matrix.xcode}}" "${{matrix.os-version}}" "${{matrix.device}}" "${{matrix.force-sim-runtime}}"
70-
- name: Install Maestro
71-
run: brew tap mobile-dev-inc/tap && brew install mobile-dev-inc/tap/maestro@1.38
72-
- name: Install iDB Companion
73-
run: brew tap facebook/fb && brew install facebook/fb/idb-companion
70+
- name: Install tooling
71+
run: make init-ci-test
7472

7573
- uses: actions/download-artifact@v4
7674
with:

Brewfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ brew 'swiftlint'
33
brew 'pre-commit'
44
brew 'python3'
55
brew 'xcbeautify'
6+
brew 'rbenv'

Brewfile-ci-deploy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
brew 'carthage'

Brewfile-ci renamed to Brewfile-ci-test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ tap 'facebook/fb'
22
brew 'facebook/fb/idb-companion'
33
tap 'mobile-dev-inc/tap'
44
brew 'mobile-dev-inc/tap/maestro'
5-
brew 'carthage'
6-
brew 'rbenv'

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ init:
33
which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
44
brew bundle
55
pre-commit install
6-
clang-format --version | awk '{print $$3}' > scripts/.clang-format-version
7-
swiftlint version > scripts/.swiftlint-version
8-
9-
# installs the tools needed to test various CI tasks locally
10-
init-ci: init
11-
brew bundle --file Brewfile-ci
126
rbenv install --skip-existing
137
rbenv exec gem update bundler
148
rbenv exec bundle install
9+
clang-format --version | awk '{print $$3}' > scripts/.clang-format-version
10+
swiftlint version > scripts/.swiftlint-version
11+
12+
# installs the tools needed to run CI test tasks locally
13+
.PHONY: init-ci-test
14+
init-ci-test:
15+
brew bundle --file Brewfile-ci-test
16+
17+
# installs the tools needed to run CI deploy tasks locally (note that carthage is preinstalled in github actions)
18+
.PHONY: init-ci-deploy
19+
init-ci-deploy:
20+
brew bundle --file Brewfile-ci-deploy
1521

1622
.PHONY: check-versions
1723
check-versions:
@@ -41,7 +47,7 @@ GIT-REF := $(shell git rev-parse --abbrev-ref HEAD)
4147

4248
test:
4349
@echo "--> Running all tests"
44-
./scripts/xcode-test.sh --platform iOS --os latest --ref $(GIT-REF) --command test --configuration Test
50+
./scripts/sentry-xcodebuild.sh --platform iOS --os latest --ref $(GIT-REF) --command test --configuration Test
4551
./scripts/xcode-slowest-tests.sh
4652
.PHONY: test
4753

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,7 @@
18231823
8459FCBF2BD73EB20038E9C9 /* SentryProfilerSerialization.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfilerSerialization.mm; sourceTree = "<group>"; };
18241824
8459FCC12BD73EEF0038E9C9 /* SentryProfilerSerialization+Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryProfilerSerialization+Test.h"; sourceTree = "<group>"; };
18251825
845C16D42A622A5B00EC9519 /* SentryTracer+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryTracer+Private.h"; path = "include/SentryTracer+Private.h"; sourceTree = "<group>"; };
1826+
846F90332D56F59D009E86C1 /* Brewfile-ci-deploy */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = "Brewfile-ci-deploy"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
18261827
848A45172BBF8D33006AAAEC /* SentryContinuousProfiler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryContinuousProfiler.h; path = ../include/SentryContinuousProfiler.h; sourceTree = "<group>"; };
18271828
848A45182BBF8D33006AAAEC /* SentryContinuousProfiler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryContinuousProfiler.mm; sourceTree = "<group>"; };
18281829
848A451B2BBF9504006AAAEC /* SentryProfilerTestHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfilerTestHelpers.h; path = ../include/SentryProfilerTestHelpers.h; sourceTree = "<group>"; };
@@ -1836,7 +1837,7 @@
18361837
849B8F962C6E906900148E1F /* SentryUserFeedbackIntegrationDriver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryUserFeedbackIntegrationDriver.swift; sourceTree = "<group>"; };
18371838
849B8F972C6E906900148E1F /* SentryUserFeedbackThemeConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SentryUserFeedbackThemeConfiguration.swift; path = Configuration/SentryUserFeedbackThemeConfiguration.swift; sourceTree = "<group>"; };
18381839
849B8F982C6E906900148E1F /* SentryUserFeedbackWidgetConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SentryUserFeedbackWidgetConfiguration.swift; path = Configuration/SentryUserFeedbackWidgetConfiguration.swift; sourceTree = "<group>"; };
1839-
849DF0522D00270A00A202DF /* Brewfile-ci */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = "Brewfile-ci"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
1840+
849DF0522D00270A00A202DF /* Brewfile-ci-test */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = "Brewfile-ci-test"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
18401841
84A305472BC72A0A00D84283 /* SentryAppLaunchProfilingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAppLaunchProfilingTests.swift; sourceTree = "<group>"; };
18411842
84A305552BC9EF8C00D84283 /* SentryTraceProfiler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryTraceProfiler.h; path = ../include/SentryTraceProfiler.h; sourceTree = "<group>"; };
18421843
84A305562BC9EF8C00D84283 /* SentryTraceProfiler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryTraceProfiler.mm; sourceTree = "<group>"; };
@@ -4040,7 +4041,8 @@
40404041
844DA80A28246D5000E6B62E /* .swiftlint.yml */,
40414042
843BD6282AD8752300B0098F /* .clang-format */,
40424043
844DA80B28246D5000E6B62E /* Brewfile */,
4043-
849DF0522D00270A00A202DF /* Brewfile-ci */,
4044+
849DF0522D00270A00A202DF /* Brewfile-ci-test */,
4045+
846F90332D56F59D009E86C1 /* Brewfile-ci-deploy */,
40444046
);
40454047
name = Aux;
40464048
sourceTree = "<group>";

0 commit comments

Comments
 (0)