1- name : " Build and Test"
1+ name : ' Build and Test'
22
33on :
44 pull_request :
@@ -15,159 +15,173 @@ permissions:
1515 id-token : write
1616
1717jobs :
18- js-tests :
19- name : " JS Tests"
20- runs-on : ubuntu-latest
21- steps :
22- - name : " Checkout"
18+ trunk-check :
19+ name : ' Trunk Check'
20+ runs-on : ubuntu-latest
21+ permissions :
22+ checks : write
23+ contents : read
24+ pull-requests : read
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v6
28+ - name : Trunk Check
29+ uses : trunk-io/trunk-action@v1
30+
31+ js-tests :
32+ name : ' JS Tests'
33+ runs-on : ubuntu-latest
34+ steps :
35+ - name : ' Checkout'
2336 uses : actions/checkout@v6
2437 - uses : actions/setup-node@v6.2.0
2538 with :
2639 node-version : 24
2740 cache : yarn
2841 cache-dependency-path : yarn.lock
2942
30- - name : " Install node modules"
43+ - name : ' Install node modules'
3144 run : |
3245 yarn install
33-
34- - name : " Run test"
46+
47+ - name : ' Run test'
3548 run : |
3649 yarn test
3750
38- android-unit-tests :
39- name : " Android Unit Tests"
40- runs-on : ubuntu-latest
41- steps :
42- - name : " Checkout"
43- uses : actions/checkout@v6
44- - name : " Run Android Unit Tests"
45- working-directory : android
46- run : ./gradlew test
47-
48- android-lint :
49- name : " Android Lint"
50- runs-on : ubuntu-latest
51- steps :
52- - name : " Checkout"
53- uses : actions/checkout@v6
54- - name : " Run Android lint"
55- working-directory : android
56- run : ./gradlew lint
57-
58- android-kotlin-lint :
59- name : " Android kotlin lint"
60- runs-on : ubuntu-latest
61- steps :
62- - name : " Checkout"
63- uses : actions/checkout@v6
64- - name : " Run Android kotlin lint"
65- working-directory : android
66- run : ./gradlew ktlintCheck
67-
68- android-sample-app :
69- name : Android Sample App
70- runs-on : ubuntu-latest
71- steps :
72- - name : Checkout
73- uses : actions/checkout@v6
74- - uses : actions/setup-node@v6.2.0
75- with :
76- node-version : 24
77- cache : yarn
78- cache-dependency-path : yarn.lock
79-
80- - name : Install node modules
81- run : yarn install
82-
83- - name : Build package
84- run : yarn dev:pack
85-
86- - name : Install sample app dependencies
87- working-directory : sample
88- run : |
89- rm -f yarn.lock
90- yarn install
91-
92- - name : Run Android sample app
93- working-directory : sample/android
94- run : ./gradlew assembleDebug
95-
96- ios-sample-app :
97- name : iOS Sample App
98- runs-on : macos-15
99- steps :
100- - name : Checkout
101- uses : actions/checkout@v6
102- - uses : actions/setup-node@v6.2.0
103- with :
104- node-version : 24
105- cache : yarn
106- cache-dependency-path : yarn.lock
107-
108- - name : Set up Xcode
109- uses : maxim-lobanov/setup-xcode@v1.6.0
110- with :
111- xcode-version : latest-stable
112-
113- - name : Set Xcode Toolchain
114- run : echo "TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault" >> $GITHUB_ENV
115-
116- - name : Setup iOS Simulator
117- uses : futureware-tech/simulator-action@v5
118- id : simulator
119- with :
120- model : iPhone 16
121- os : iOS
122- os_version : " >=18.0"
123- wait_for_boot : true
124- shutdown_after_job : true
125-
126- - name : Install node modules
127- run : yarn install
128-
129- - name : Build package
130- run : yarn dev:pack
131-
132- - name : Install sample app dependencies
133- working-directory : sample
134- run : |
135- rm -f yarn.lock
136- yarn install
137-
138- - name : Install Ruby dependencies
139- working-directory : sample
140- run : bundle install
141-
142- - name : Build iOS sample app
143- working-directory : sample/ios
144- run : |
145- bundle exec pod install
146- set -o pipefail && xcodebuild -workspace MParticleSample.xcworkspace \
147- -configuration Debug \
148- -scheme MParticleSample \
149- -destination 'id=${{ steps.simulator.outputs.udid }}' \
150- -derivedDataPath ios/build \
151- -UseModernBuildSystem=YES \
152- build | bundle exec xcpretty -k
153-
154- pr-notify :
155- if : >
156- github.event_name == 'pull_request' &&
157- github.event.pull_request.draft == false
158- needs :
159- - android-unit-tests
160- - android-lint
161- - android-kotlin-lint
162- - android-sample-app
163- - ios-sample-app
164- - js-tests
165- name : Notify GChat
166- uses : ROKT/rokt-workflows/.github/workflows/oss_pr_opened_notification.yml@main
167- secrets :
168- gchat_webhook : ${{ secrets.GCHAT_PRS_WEBHOOK }}
169-
170- automerge-dependabot :
171- name : " Save PR Number for Dependabot Automerge"
172- needs : [ js-tests, android-unit-tests, android-lint, android-kotlin-lint ]
173- uses : mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main
51+ android-unit-tests :
52+ name : ' Android Unit Tests'
53+ runs-on : ubuntu-latest
54+ steps :
55+ - name : ' Checkout'
56+ uses : actions/checkout@v6
57+ - name : ' Run Android Unit Tests'
58+ working-directory : android
59+ run : ./gradlew test
60+
61+ android-lint :
62+ name : ' Android Lint'
63+ runs-on : ubuntu-latest
64+ steps :
65+ - name : ' Checkout'
66+ uses : actions/checkout@v6
67+ - name : ' Run Android lint'
68+ working-directory : android
69+ run : ./gradlew lint
70+
71+ android-kotlin-lint :
72+ name : ' Android kotlin lint'
73+ runs-on : ubuntu-latest
74+ steps :
75+ - name : ' Checkout'
76+ uses : actions/checkout@v6
77+ - name : ' Run Android kotlin lint'
78+ working-directory : android
79+ run : ./gradlew ktlintCheck
80+
81+ android-sample-app :
82+ name : Android Sample App
83+ runs-on : ubuntu-latest
84+ steps :
85+ - name : Checkout
86+ uses : actions/checkout@v6
87+ - uses : actions/setup-node@v6.2.0
88+ with :
89+ node-version : 24
90+ cache : yarn
91+ cache-dependency-path : yarn.lock
92+
93+ - name : Install node modules
94+ run : yarn install
95+
96+ - name : Build package
97+ run : yarn dev:pack
98+
99+ - name : Install sample app dependencies
100+ working-directory : sample
101+ run : |
102+ rm -f yarn.lock
103+ yarn install
104+
105+ - name : Run Android sample app
106+ working-directory : sample/android
107+ run : ./gradlew assembleDebug
108+
109+ ios-sample-app :
110+ name : iOS Sample App
111+ runs-on : macos-15
112+ steps :
113+ - name : Checkout
114+ uses : actions/checkout@v6
115+ - uses : actions/setup-node@v6.2.0
116+ with :
117+ node-version : 24
118+ cache : yarn
119+ cache-dependency-path : yarn.lock
120+
121+ - name : Set up Xcode
122+ uses : maxim-lobanov/setup-xcode@v1.6.0
123+ with :
124+ xcode-version : latest-stable
125+
126+ - name : Set Xcode Toolchain
127+ run : echo "TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault" >> $GITHUB_ENV
128+
129+ - name : Setup iOS Simulator
130+ uses : futureware-tech/simulator-action@v5
131+ id : simulator
132+ with :
133+ model : iPhone 16
134+ os : iOS
135+ os_version : ' >=18.0'
136+ wait_for_boot : true
137+ shutdown_after_job : true
138+
139+ - name : Install node modules
140+ run : yarn install
141+
142+ - name : Build package
143+ run : yarn dev:pack
144+
145+ - name : Install sample app dependencies
146+ working-directory : sample
147+ run : |
148+ rm -f yarn.lock
149+ yarn install
150+
151+ - name : Install Ruby dependencies
152+ working-directory : sample
153+ run : bundle install
154+
155+ - name : Build iOS sample app
156+ working-directory : sample/ios
157+ run : |
158+ bundle exec pod install
159+ set -o pipefail && xcodebuild -workspace MParticleSample.xcworkspace \
160+ -configuration Debug \
161+ -scheme MParticleSample \
162+ -destination 'id=${{ steps.simulator.outputs.udid }}' \
163+ -derivedDataPath ios/build \
164+ -UseModernBuildSystem=YES \
165+ build | bundle exec xcpretty -k
166+
167+ pr-notify :
168+ if : >
169+ github.event_name == 'pull_request' &&
170+ github.event.pull_request.draft == false
171+ needs :
172+ - trunk-check
173+ - android-unit-tests
174+ - android-lint
175+ - android-kotlin-lint
176+ - android-sample-app
177+ - ios-sample-app
178+ - js-tests
179+ name : Notify GChat
180+ uses : ROKT/rokt-workflows/.github/workflows/oss_pr_opened_notification.yml@main
181+ secrets :
182+ gchat_webhook : ${{ secrets.GCHAT_PRS_WEBHOOK }}
183+
184+ automerge-dependabot :
185+ name : ' Save PR Number for Dependabot Automerge'
186+ needs : [js-tests, android-unit-tests, android-lint, android-kotlin-lint]
187+ uses : mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main
0 commit comments