Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit c534159

Browse files
authored
quality: parameterize branch names and extract test action (#65)
1 parent b4340bb commit c534159

File tree

3 files changed

+53
-15
lines changed

3 files changed

+53
-15
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Test SDK'
2+
description: 'Unit and Universal Tests'
3+
inputs:
4+
test_data_branch:
5+
type: string
6+
description: The branch in sdk-test-data to target for testcase files
7+
required: false
8+
default: main
9+
sdk_branch:
10+
type: string
11+
description: The branch of the SDK to test
12+
required: false
13+
default: main
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Display Testing Details
19+
shell: bash
20+
run: |
21+
echo "Running SDK Test using"
22+
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
23+
echo "SDK Branch: python-sdk@${SDK_BRANCH_NAME}"
24+
env:
25+
SDK_BRANCH_NAME: ${{ inputs.sdk_branch }}
26+
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch }}
27+
28+
- uses: "actions/checkout@v2"
29+
with:
30+
repository: Eppo-exp/python-sdk
31+
ref: ${{ inputs.sdk_branch }}
32+
- uses: "actions/setup-python@v2"
33+
with:
34+
python-version: '3.9.x'
35+
- name: "Install dependencies"
36+
shell: bash
37+
run: |
38+
python -VV
39+
python -m pip install --upgrade pip setuptools wheel
40+
python -m pip install -r requirements.txt
41+
python -m pip install -r requirements-test.txt
42+
- name: "Run tests"
43+
shell: bash
44+
run: make test branchName=$BRANCH
45+
env:
46+
BRANCH: ${{ inputs.test_data_branch }}

.github/workflows/test-and-lint-sdk.yml renamed to .github/workflows/lint-test-sdk.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- '**/*'
7+
workflow_dispatch:
78

89

910
jobs:
@@ -50,17 +51,6 @@ jobs:
5051
run-tests-with-tox:
5152
runs-on: ubuntu-latest
5253
steps:
53-
- uses: "actions/checkout@v2"
54-
- uses: "actions/setup-python@v2"
55-
with:
56-
python-version: '3.9.x'
57-
- name: "Install dependencies"
58-
run: |
59-
python -VV
60-
python -m pip install --upgrade pip setuptools wheel
61-
python -m pip install -r requirements.txt
62-
python -m pip install -r requirements-test.txt
63-
- name: 'Set up GCP SDK to download test data'
64-
uses: 'google-github-actions/setup-gcloud@v0'
65-
- name: "Run tests"
66-
run: make test
54+
- uses: Eppo-exp/python-sdk/.github/actions/action-test@tp/workflows/remote
55+
with:
56+
sdk_branch: ${{ github.head_ref || github.ref_name }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ __pycache__
66
.tox/
77
test-data
88
venv/
9-
.DS_Store
9+
.DS_Store
10+
.venv
11+
.idea

0 commit comments

Comments
 (0)