Skip to content

Commit 9b4a515

Browse files
authored
quality: First batch of Local and Remote SDK testing (#57)
* use the SDK workflows locally (php, dotnet, node-server) * set up new Remote test run workflow
1 parent 4727ce6 commit 9b4a515

File tree

2 files changed

+88
-69
lines changed

2 files changed

+88
-69
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test SDKs Remotely
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
11+
test-php-sdk:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Display workflow details
15+
shell: bash
16+
run: |
17+
echo "Testing eppo-exp/php-sdk"
18+
- name: Run remote workflow
19+
uses: convictional/[email protected]
20+
with:
21+
owner: Eppo-exp
22+
repo: php-sdk
23+
workflow_file_name: run-tests.yml
24+
ref: main
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: main
45+
github_token: ${{ secrets.AUTH_TOKEN }}
46+
wait_interval: 10
47+
propagate_failure: true
48+
trigger_workflow: true
49+
wait_workflow: true
50+
51+
test-dotnet-sdk:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Display workflow details
55+
shell: bash
56+
run: |
57+
echo "Testing Eppo-exp/dot-net-server-sdk"
58+
- name: Run remote workflow
59+
uses: convictional/[email protected]
60+
with:
61+
owner: Eppo-exp
62+
repo: dot-net-server-sdk
63+
workflow_file_name: run-tests.yml
64+
ref: main
65+
github_token: ${{ secrets.AUTH_TOKEN }}
66+
wait_interval: 10
67+
propagate_failure: true
68+
trigger_workflow: true
69+
wait_workflow: true
70+

.github/workflows/test-sdks.yml

Lines changed: 18 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Test SDKs
1+
name: Test SDKs Locally
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
pull_request:
5+
branches: [ "*" ]
6+
77
workflow_dispatch:
88

99
jobs:
@@ -81,31 +81,10 @@ jobs:
8181
path: /Users/runner/work/sdk-test-data/sdk-test-data/eppo/build/reports/androidTests/connected/index.html
8282

8383
test-node-server-sdk:
84-
runs-on: ubuntu-latest
85-
steps:
86-
- name: 'Check out node server SDK'
87-
uses: actions/checkout@v3
88-
with:
89-
repository: 'Eppo-exp/node-server-sdk'
90-
- name: Use Node.js 18
91-
uses: actions/setup-node@v1
92-
with:
93-
node-version: '18.x'
94-
- uses: actions/cache@v2
95-
with:
96-
path: './node_modules'
97-
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
98-
- name: Install root dependencies
99-
run: yarn --frozen-lockfile
100-
working-directory: ./
101-
- name: 'Set up GCP SDK for downloading test data'
102-
uses: 'google-github-actions/setup-gcloud@v0'
103-
- name: Install sdk dependencies
104-
run: yarn --frozen-lockfile
105-
working-directory: ./
106-
- name: Run tests
107-
run: yarn test:unit
108-
working-directory: ./
84+
uses: Eppo-exp/node-server-sdk/.github/workflows/lint-test-sdk.yml@main
85+
with:
86+
test_data_branch: ${{ github.head_ref || github.ref_name }}
87+
sdk_branch: main
10988

11089
test-node-client-sdk:
11190
runs-on: ubuntu-latest
@@ -168,27 +147,11 @@ jobs:
168147
run: make test
169148

170149
test-php-sdk:
171-
runs-on: ubuntu-latest
172-
steps:
173-
- name: Check out PHP SDK
174-
uses: actions/checkout@v3
175-
with:
176-
repository: 'Eppo-exp/php-sdk'
177-
- name: Validate composer.json and composer.lock
178-
run: composer validate --strict
179-
- name: Cache Composer packages
180-
id: composer-cache
181-
uses: actions/cache@v3
182-
with:
183-
path: vendor
184-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
185-
restore-keys: |
186-
${{ runner.os }}-php-
187-
- name: Install dependencies
188-
run: composer install --prefer-dist --no-progress
189-
- name: Run tests
190-
run: make test
191-
150+
uses: Eppo-exp/php-sdk/.github/workflows/run-tests.yml@main
151+
with:
152+
test_data_branch: ${{ github.head_ref || github.ref_name }}
153+
sdk_branch: main
154+
192155
test-ruby-sdk:
193156
runs-on: ubuntu-latest
194157
steps:
@@ -241,23 +204,9 @@ jobs:
241204
uses: 'google-github-actions/setup-gcloud@v0'
242205
- name: Run tests
243206
run: make test
244-
207+
245208
test-dotnet-sdk:
246-
runs-on: ubuntu-latest
247-
steps:
248-
- name: Checkout Dot.net SDK
249-
uses: actions/checkout@v3
250-
with:
251-
repository: 'Eppo-exp/dot-net-server-sdk'
252-
- name: Setup .NET 7
253-
uses: actions/setup-dotnet@v3
254-
with:
255-
dotnet-version: 7.0.x
256-
- name: Restore dependencies
257-
run: dotnet restore
258-
- name: Build
259-
run: make build
260-
- name: Pull test data
261-
run: make test-data
262-
- name: Run tests
263-
run: make test
209+
uses: Eppo-exp/dot-net-server-sdk/.github/workflows/run-tests.yml@main
210+
with:
211+
test_data_branch: ${{ github.head_ref || github.ref_name }}
212+
sdk_branch: main

0 commit comments

Comments
 (0)