Skip to content

Commit a4f0ba1

Browse files
authored
chore: Migrate SDKs to common testing pattern
1 parent 580a7e3 commit a4f0ba1

File tree

2 files changed

+26
-123
lines changed

2 files changed

+26
-123
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ jobs:
1313
test-sdks:
1414
runs-on: ubuntu-latest
1515
strategy:
16+
fail-fast: false
1617
matrix:
1718
sdk:
19+
- { repo: "android-sdk", workflow: "test.yaml", ref: "main" }
20+
- { repo: "dot-net-server-sdk", workflow: "run-tests.yml", ref: "main" }
21+
- { repo: "eppo-ios-sdk", workflow: "unit-tests.yml", ref: "main" }
22+
- { repo: "golang-sdk", workflow: "test.yml", ref: "main" }
1823
- { repo: "java-server-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
19-
- { repo: "php-sdk", workflow: "run-tests.yml", ref: "main" }
2024
- { repo: "js-client-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
21-
- { repo: "python-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
2225
- { repo: "node-server-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
23-
- { repo: "dot-net-server-sdk", workflow: "run-tests.yml", ref: "main" }
26+
- { repo: "php-sdk", workflow: "run-tests.yml", ref: "main" }
27+
- { repo: "python-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
28+
- { repo: "react-native-sdk", workflow: "ci.yml", ref: "main" }
2429
steps:
2530
- name: Display workflow details
2631
shell: bash
@@ -38,5 +43,3 @@ jobs:
3843
propagate_failure: true
3944
trigger_workflow: true
4045
wait_workflow: true
41-
42-

.github/workflows/test-sdks.yml

Lines changed: 18 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
pull_request:
55
paths:
66
- 'ufc/**'
7-
8-
97
workflow_dispatch:
108

119
jobs:
@@ -17,60 +15,11 @@ jobs:
1715
sdk_branch: main
1816

1917
test-android-sdk:
20-
runs-on: macos-latest
21-
steps:
22-
- name: Check out Java SDK
23-
uses: actions/checkout@v3
24-
with:
25-
repository: 'Eppo-exp/android-sdk'
26-
- name: Set up JDK 11
27-
uses: actions/setup-java@v3
28-
with:
29-
java-version: '11'
30-
distribution: 'adopt'
31-
- name: 'Set up GCP SDK'
32-
uses: 'google-github-actions/setup-gcloud@v0'
33-
- name: Restore gradle.properties
34-
env:
35-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
36-
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
37-
shell: bash
38-
run: |
39-
mkdir -p ~/.gradle/
40-
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
41-
echo "MAVEN_USERNAME=${MAVEN_USERNAME}" > ~/.gradle/gradle.properties
42-
echo "MAVEN_PASSWORD=${MAVEN_PASSWORD}" >> ~/.gradle/gradle.properties
43-
- name: Set up test data
44-
run: make test-data
45-
- name: Spin up emulator and run tests
46-
id: testing
47-
uses: ReactiveCircus/android-emulator-runner@v2
48-
with:
49-
api-level: 33
50-
target: google_apis
51-
arch: x86_64
52-
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -dns-server 8.8.8.8
53-
script: |
54-
echo "Emulator started"
55-
adb logcat -c # clear logs
56-
mkdir -p app/ # create directory
57-
touch app/emulator.log # create log file
58-
chmod 777 app/emulator.log # allow writing to log file
59-
adb logcat | grep EppoSDK >> app/emulator.log & # pipe all logcat messages into log file as a background process
60-
./gradlew connectedCheck # run tests
61-
- name: Upload Emulator Logs
62-
if: always()
63-
uses: actions/upload-artifact@v2
64-
with:
65-
name: emulator logs
66-
path: app/emulator.log
67-
- name: Upload Test Report
68-
if: always()
69-
uses: actions/upload-artifact@v2
70-
with:
71-
name: report
72-
path: /Users/runner/work/sdk-test-data/sdk-test-data/eppo/build/reports/androidTests/connected/index.html
73-
18+
uses: Eppo-exp/android-sdk/.github/workflows/test.yaml@main
19+
with:
20+
test_data_branch: ${{ github.head_ref || github.ref_name }}
21+
sdk_branch: main
22+
7423
test-node-server-sdk:
7524
uses: Eppo-exp/node-server-sdk/.github/workflows/lint-test-sdk.yml@main
7625
with:
@@ -84,18 +33,10 @@ jobs:
8433
sdk_branch: main
8534

8635
test-react-native-sdk:
87-
runs-on: ubuntu-latest
88-
steps:
89-
- name: Checkout React Native SDK
90-
uses: actions/checkout@v3
91-
with:
92-
repository: 'Eppo-exp/react-native-sdk'
93-
- name: Setup
94-
uses: ./.github/actions/setup
95-
- name: Install dependencies
96-
run: yarn install
97-
- name: Run tests
98-
run: yarn test --maxWorkers=2 --coverage
36+
uses: Eppo-exp/react-native-sdk/.github/workflows/ci.yml@main
37+
with:
38+
test_data_branch: ${{ github.head_ref || github.ref_name }}
39+
sdk_branch: main
9940

10041
test-python-sdk:
10142
runs-on: ubuntu-latest
@@ -112,58 +53,17 @@ jobs:
11253
test_data_branch: ${{ github.head_ref || github.ref_name }}
11354
sdk_branch: main
11455

115-
test-ruby-sdk:
116-
runs-on: ubuntu-latest
117-
steps:
118-
- name: Check out Ruby SDK
119-
uses: actions/checkout@v3
120-
with:
121-
repository: 'Eppo-exp/ruby-sdk'
122-
- name: Set up Ruby 3
123-
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
124-
with:
125-
ruby-version: 3.0.6
126-
- name: Install dependencies
127-
run: bundle install
128-
- name: Refresh test data
129-
run: bundle exec rake test_refreshed_data
130-
- name: Run tests
131-
run: bundle exec rake test
132-
13356
test-ios-sdk:
134-
runs-on: macos-latest
135-
steps:
136-
- name: Checkout iOS SDK
137-
uses: actions/checkout@v3
138-
with:
139-
repository: 'Eppo-exp/eppo-ios-sdk'
140-
- name: 'Set up Cloud SDK'
141-
uses: 'google-github-actions/setup-gcloud@v1'
142-
- name: 'Use gcloud CLI'
143-
run: 'gcloud info'
144-
- name: Build
145-
run: make build
146-
- name: Pull test data
147-
run: make test-data
148-
- name: Run tests
149-
run: make test
150-
57+
uses: Eppo-exp/eppo-ios-sdk/.github/workflows/unit-tests.yml@main
58+
with:
59+
test_data_branch: ${{ github.head_ref || github.ref_name }}
60+
sdk_branch: main
61+
15162
test-golang-sdk:
152-
runs-on: ubuntu-latest
153-
steps:
154-
- name: Checkout Go SDK
155-
uses: actions/checkout@v3
156-
with:
157-
repository: 'Eppo-exp/golang-sdk'
158-
- uses: actions/setup-go@v3
159-
with:
160-
go-version: 1.19
161-
- name: Build
162-
run: go build -v ./...
163-
- name: 'Set up GCP SDK for downloading test data'
164-
uses: 'google-github-actions/setup-gcloud@v0'
165-
- name: Run tests
166-
run: make test
63+
uses: Eppo-exp/golang-sdk/.github/workflows/test.yml@main
64+
with:
65+
test_data_branch: ${{ github.head_ref || github.ref_name }}
66+
sdk_branch: main
16767

16868
test-dotnet-sdk:
16969
uses: Eppo-exp/dot-net-server-sdk/.github/workflows/run-tests.yml@main

0 commit comments

Comments
 (0)