Skip to content

Commit 9956312

Browse files
committed
node server sdk
1 parent 814d43e commit 9956312

File tree

2 files changed

+235
-14
lines changed

2 files changed

+235
-14
lines changed

.github/workflows/test-sdks-remote.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Test SDKs Remotely
22

3-
env:
4-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
5-
63
on:
74
push:
85
branches:
@@ -14,24 +11,39 @@ jobs:
1411
test-php-sdk:
1512
runs-on: ubuntu-latest
1613
steps:
17-
- name: Echo Current Branch Name
14+
- name: Display workflow details
1815
shell: bash
1916
run: |
2017
echo "Testing eppo-exp/php-sdk"
21-
- name: Echo Workflow Name
22-
shell: bash
23-
run: |
24-
echo "Testing data on branch ${BRANCH_NAME}"
2518
- name: Run remote workflow
2619
uses: convictional/[email protected]
2720
with:
2821
owner: Eppo-exp
2922
repo: php-sdk
3023
workflow_file_name: run-tests.yml
31-
ref: tp/action/branch
24+
ref: tp/workflows/remote
25+
github_token: ${{ secrets.AUTH_TOKEN }}
26+
wait_interval: 10
27+
propagate_failure: true
28+
trigger_workflow: true
29+
wait_workflow: true
30+
31+
test-node-server-sdk:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Display workflow details
35+
shell: bash
36+
run: |
37+
echo "Testing eppo-exp/node-server-sdk"
38+
- name: Run remote workflow
39+
uses: convictional/[email protected]
40+
with:
41+
owner: Eppo-exp
42+
repo: node-server-sdk
43+
workflow_file_name: lint-test-sdk.yml
44+
ref: tp/workflows/remote
3245
github_token: ${{ secrets.AUTH_TOKEN }}
3346
wait_interval: 10
3447
propagate_failure: true
3548
trigger_workflow: true
3649
wait_workflow: true
37-
client_payload: '{"test_data_branch": "tp/tests/actions"}'

.github/workflows/test-sdks.yml

Lines changed: 213 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,223 @@
11
name: Test SDKs Locally
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
pull_request:
5+
types: [opened, synchronize]
76
workflow_dispatch:
87

98
jobs:
109

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+
11147
test-php-sdk:
12148
uses: Eppo-exp/php-sdk/.github/workflows/run-tests.yml@tp/workflows/remote
13149
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

Comments
 (0)