66 workflow_call :
77 workflow_dispatch :
88
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+ cancel-in-progress : true
12+
13+ permissions :
14+ contents : read
15+ pull-requests : read
16+ checks : write
17+ id-token : write
18+
919jobs :
1020 js-tests :
1121 name : " JS Tests"
12- runs-on : macOS -latest
22+ runs-on : ubuntu -latest
1323 steps :
1424 - name : " Checkout"
1525 uses : actions/checkout@v4
16- - uses : actions/setup-node@master
17- - uses : c-hive/gha-yarn-cache@v2
26+ 27+ with :
28+ node-version : 18
29+ cache : yarn
30+ cache-dependency-path : yarn.lock
1831
1932 - name : " Install node modules"
2033 run : |
@@ -35,25 +48,114 @@ jobs:
3548 run : ./gradlew test
3649
3750 android-lint :
38- name : " Android Unit Tests "
51+ name : " Android Lint "
3952 runs-on : ubuntu-latest
4053 steps :
4154 - name : " Checkout"
4255 uses : actions/checkout@v4
43- - name : " Run Android Unit Tests "
56+ - name : " Run Android lint "
4457 working-directory : android
4558 run : ./gradlew lint
4659
4760 android-kotlin-lint :
48- name : " Android Unit Tests "
61+ name : " Android kotlin lint "
4962 runs-on : ubuntu-latest
5063 steps :
5164 - name : " Checkout"
5265 uses : actions/checkout@v4
53- - name : " Run Android Unit Tests "
66+ - name : " Run Android kotlin lint "
5467 working-directory : android
5568 run : ./gradlew ktlintCheck
5669
70+ android-sample-app :
71+ name : Android Sample App
72+ runs-on : ubuntu-latest
73+ steps :
74+ - name : Checkout
75+ uses : actions/checkout@v4
76+ 77+ with :
78+ node-version : 18
79+ cache : yarn
80+ cache-dependency-path : yarn.lock
81+
82+ - name : Install node modules
83+ run : yarn install
84+
85+ - name : Build package
86+ run : yarn dev:pack
87+
88+ - name : Install sample app dependencies
89+ working-directory : sample
90+ run : |
91+ rm -f yarn.lock
92+ yarn install
93+
94+ - name : Run Android sample app
95+ working-directory : sample/android
96+ run : ./gradlew assembleDebug
97+
98+ ios-sample-app :
99+ name : iOS Sample App
100+ runs-on : macos-15
101+ steps :
102+ - name : Checkout
103+ uses : actions/checkout@v4
104+ 105+ with :
106+ node-version : 18
107+ cache : yarn
108+ cache-dependency-path : yarn.lock
109+
110+ - name : Set up Xcode
111+ uses :
maxim-lobanov/[email protected] 112+ with :
113+ xcode-version : 16.3
114+
115+ - name : Install node modules
116+ run : yarn install
117+
118+ - name : Build package
119+ run : yarn dev:pack
120+
121+ - name : Install sample app dependencies
122+ working-directory : sample
123+ run : |
124+ rm -f yarn.lock
125+ yarn install
126+
127+ - name : Install Ruby dependencies
128+ working-directory : sample
129+ run : bundle install
130+
131+ - name : Build iOS sample app
132+ working-directory : sample/ios
133+ run : |
134+ bundle exec pod install
135+ set -o pipefail && xcodebuild -workspace MParticleSample.xcworkspace \
136+ -configuration Debug \
137+ -scheme MParticleSample \
138+ -destination 'platform=iOS Simulator,name=iPhone 16' \
139+ -derivedDataPath ios/build \
140+ -UseModernBuildSystem=YES \
141+ build | bundle exec xcpretty -k
142+
143+ pr-notify :
144+ if : >
145+ github.event_name == 'pull_request' &&
146+ github.event.pull_request.draft == false
147+ needs :
148+ - android-unit-tests
149+ - android-lint
150+ - android-kotlin-lint
151+ - android-sample-app
152+ - ios-sample-app
153+ - js-tests
154+ name : Notify GChat
155+ uses : ROKT/rokt-workflows/.github/workflows/oss_pr_opened_notification.yml@main
156+ secrets :
157+ gchat_webhook : ${{ secrets.GCHAT_PRS_WEBHOOK }}
158+
57159 automerge-dependabot :
58160 name : " Save PR Number for Dependabot Automerge"
59161 needs : [ js-tests, android-unit-tests, android-lint, android-kotlin-lint ]
0 commit comments