1
1
name : Test SDKs Locally
2
2
3
3
on :
4
- push :
5
- branches :
6
- - main
4
+ pull_request :
5
+ types : [opened, synchronize]
7
6
workflow_dispatch :
8
7
9
8
jobs :
10
9
10
+ test-java-sdk :
11
+ runs-on : macos-latest
12
+ steps :
13
+ - name : Check out Java SDK
14
+ uses : actions/checkout@v3
15
+ with :
16
+ repository : ' Eppo-exp/java-server-sdk'
17
+ - name : Set up JDK 11
18
+ uses : actions/setup-java@v3
19
+ with :
20
+ java-version : ' 11'
21
+ distribution : ' adopt'
22
+ - name : ' Set up GCP SDK'
23
+ uses : ' google-github-actions/setup-gcloud@v0'
24
+ - name : Run tests
25
+ run : make test
26
+
27
+ test-android-sdk :
28
+ runs-on : macos-latest
29
+ steps :
30
+ - name : Check out Java SDK
31
+ uses : actions/checkout@v3
32
+ with :
33
+ repository : ' Eppo-exp/android-sdk'
34
+ - name : Set up JDK 11
35
+ uses : actions/setup-java@v3
36
+ with :
37
+ java-version : ' 11'
38
+ distribution : ' adopt'
39
+ - name : ' Set up GCP SDK'
40
+ uses : ' google-github-actions/setup-gcloud@v0'
41
+ - name : Restore gradle.properties
42
+ env :
43
+ MAVEN_USERNAME : ${{ secrets.MAVEN_USERNAME }}
44
+ MAVEN_PASSWORD : ${{ secrets.MAVEN_PASSWORD }}
45
+ shell : bash
46
+ run : |
47
+ mkdir -p ~/.gradle/
48
+ echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
49
+ echo "MAVEN_USERNAME=${MAVEN_USERNAME}" > ~/.gradle/gradle.properties
50
+ echo "MAVEN_PASSWORD=${MAVEN_PASSWORD}" >> ~/.gradle/gradle.properties
51
+ - name : Set up test data
52
+ run : make test-data
53
+ - name : Spin up emulator and run tests
54
+ id : testing
55
+ uses : ReactiveCircus/android-emulator-runner@v2
56
+ with :
57
+ api-level : 33
58
+ target : google_apis
59
+ arch : x86_64
60
+ emulator-options : -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -dns-server 8.8.8.8
61
+ script : |
62
+ echo "Emulator started"
63
+ adb logcat -c # clear logs
64
+ mkdir -p app/ # create directory
65
+ touch app/emulator.log # create log file
66
+ chmod 777 app/emulator.log # allow writing to log file
67
+ adb logcat | grep EppoSDK >> app/emulator.log & # pipe all logcat messages into log file as a background process
68
+ ./gradlew connectedCheck # run tests
69
+ - name : Upload Emulator Logs
70
+ if : always()
71
+ uses : actions/upload-artifact@v2
72
+ with :
73
+ name : emulator logs
74
+ path : app/emulator.log
75
+ - name : Upload Test Report
76
+ if : always()
77
+ uses : actions/upload-artifact@v2
78
+ with :
79
+ name : report
80
+ path : /Users/runner/work/sdk-test-data/sdk-test-data/eppo/build/reports/androidTests/connected/index.html
81
+
82
+ test-node-server-sdk :
83
+ uses : Eppo-exp/node-server-sdk/.github/workflows/lint-test-sdk.yml@tp/workflows/remote
84
+ with :
85
+ test_data_branch : ${{ github.head_ref || github.ref_name }}
86
+
87
+ test-node-client-sdk :
88
+ runs-on : ubuntu-latest
89
+ steps :
90
+ - name : Check out node client SDK
91
+ uses : actions/checkout@v3
92
+ with :
93
+ repository : ' Eppo-exp/js-client-sdk'
94
+ - name : Use Node.js 18
95
+ uses : actions/setup-node@v1
96
+ with :
97
+ node-version : ' 18.x'
98
+ - uses : actions/cache@v2
99
+ with :
100
+ path : ' ./node_modules'
101
+ key : ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
102
+ - name : ' Set up GCP SDK for downloading test data'
103
+ uses : ' google-github-actions/setup-gcloud@v0'
104
+ - name : Install SDK dependencies
105
+ run : yarn --frozen-lockfile
106
+ working-directory : ./
107
+ - name : Run tests
108
+ run : yarn test
109
+ working-directory : ./
110
+
111
+ test-react-native-sdk :
112
+ runs-on : ubuntu-latest
113
+ steps :
114
+ - name : Checkout React Native SDK
115
+ uses : actions/checkout@v3
116
+ with :
117
+ repository : ' Eppo-exp/react-native-sdk'
118
+ - name : Setup
119
+ uses : ./.github/actions/setup
120
+ - name : Install dependencies
121
+ run : yarn install
122
+ - name : Run tests
123
+ run : yarn test --maxWorkers=2 --coverage
124
+
125
+ test-python-sdk :
126
+ runs-on : ubuntu-latest
127
+ steps :
128
+ - name : ' Check out Python SDK'
129
+ uses : " actions/checkout@v3"
130
+ with :
131
+ repository : ' Eppo-exp/python-sdk'
132
+ - name : Install Python 3.9
133
+ uses : " actions/setup-python@v2"
134
+ with :
135
+ python-version : ' 3.9.x'
136
+ - name : " Install dependencies"
137
+ run : |
138
+ python -VV
139
+ python -m pip install --upgrade pip setuptools wheel
140
+ python -m pip install -r requirements.txt
141
+ python -m pip install -r requirements-test.txt
142
+ - name : ' Set up GCP SDK to download test data'
143
+ uses : ' google-github-actions/setup-gcloud@v0'
144
+ - name : Run tests
145
+ run : make test
146
+
11
147
test-php-sdk :
12
148
uses : Eppo-exp/php-sdk/.github/workflows/run-tests.yml@tp/workflows/remote
13
149
with :
14
- test_data_branch : ${{ github.head_ref || github.ref_name }}
150
+ test_data_branch : ${{ github.head_ref || github.ref_name }}
151
+
152
+ test-ruby-sdk :
153
+ runs-on : ubuntu-latest
154
+ steps :
155
+ - name : Check out Ruby SDK
156
+ uses : actions/checkout@v3
157
+ with :
158
+ repository : ' Eppo-exp/ruby-sdk'
159
+ - name : Set up Ruby 3
160
+ uses : ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
161
+ with :
162
+ ruby-version : 3.0.6
163
+ - name : Install dependencies
164
+ run : bundle install
165
+ - name : Refresh test data
166
+ run : bundle exec rake test_refreshed_data
167
+ - name : Run tests
168
+ run : bundle exec rake test
169
+
170
+ test-ios-sdk :
171
+ runs-on : macos-latest
172
+ steps :
173
+ - name : Checkout iOS SDK
174
+ uses : actions/checkout@v3
175
+ with :
176
+ repository : ' Eppo-exp/eppo-ios-sdk'
177
+ - name : ' Set up Cloud SDK'
178
+ uses : ' google-github-actions/setup-gcloud@v1'
179
+ - name : ' Use gcloud CLI'
180
+ run : ' gcloud info'
181
+ - name : Build
182
+ run : make build
183
+ - name : Pull test data
184
+ run : make test-data
185
+ - name : Run tests
186
+ run : make test
187
+
188
+ test-golang-sdk :
189
+ runs-on : ubuntu-latest
190
+ steps :
191
+ - name : Checkout Go SDK
192
+ uses : actions/checkout@v3
193
+ with :
194
+ repository : ' Eppo-exp/golang-sdk'
195
+ - uses : actions/setup-go@v3
196
+ with :
197
+ go-version : 1.19
198
+ - name : Build
199
+ run : go build -v ./...
200
+ - name : ' Set up GCP SDK for downloading test data'
201
+ uses : ' google-github-actions/setup-gcloud@v0'
202
+ - name : Run tests
203
+ run : make test
204
+
205
+ test-dotnet-sdk :
206
+ runs-on : ubuntu-latest
207
+ steps :
208
+ - name : Checkout Dot.net SDK
209
+ uses : actions/checkout@v3
210
+ with :
211
+ repository : ' Eppo-exp/dot-net-server-sdk'
212
+ - name : Setup .NET 7
213
+ uses : actions/setup-dotnet@v3
214
+ with :
215
+ dotnet-version : 7.0.x
216
+ - name : Restore dependencies
217
+ run : dotnet restore
218
+ - name : Build
219
+ run : make build
220
+ - name : Pull test data
221
+ run : make test-data
222
+ - name : Run tests
223
+ run : make test
0 commit comments