Skip to content

Commit e74b5d8

Browse files
authored
Vb/test multiple sdk versions plt 1320 (#1792)
1 parent 9fe1695 commit e74b5d8

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

.github/workflows/python-package-develop.yml

+29-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,31 @@ jobs:
2828
filters: |
2929
labelbox:
3030
- 'libs/labelbox/**'
31+
get_sdk_versions:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
sdk_versions: ${{ steps.get_sdk_versions.outputs.sdk_versions }}
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
with:
39+
ref: ${{ github.event.repository.default_branch }}
40+
41+
- name: Fetch tags
42+
run: git fetch --tags
43+
44+
- name: Get Latest SDK versions
45+
id: get_sdk_versions
46+
run: |
47+
sdk_versions=$(git tag --list --sort=-version:refname "v.*" | head -n 4 | jq -R -s -c 'split("\n")[:-1]')
48+
if [ -z "$sdk_versions" ]; then
49+
echo "No tags found"
50+
exit 1
51+
fi
52+
echo "sdk_versions=$sdk_versions"
53+
echo "sdk_versions=$sdk_versions" >> $GITHUB_OUTPUT
3154
build:
32-
needs: ['path-filter']
55+
needs: ['path-filter', 'get_sdk_versions']
3356
if: ${{ needs.path-filter.outputs.labelbox == 'true' }}
3457
strategy:
3558
fail-fast: false
@@ -38,15 +61,19 @@ jobs:
3861
- python-version: 3.8
3962
api-key: STAGING_LABELBOX_API_KEY_2
4063
da-test-key: DA_GCP_LABELBOX_API_KEY
64+
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[3] }}
4165
- python-version: 3.9
4266
api-key: STAGING_LABELBOX_API_KEY_3
4367
da-test-key: DA_GCP_LABELBOX_API_KEY
68+
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[2] }}
4469
- python-version: "3.10"
4570
api-key: STAGING_LABELBOX_API_KEY_4
4671
da-test-key: DA_GCP_LABELBOX_API_KEY
72+
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[1] }}
4773
- python-version: 3.11
4874
api-key: STAGING_LABELBOX_API_KEY
4975
da-test-key: DA_GCP_LABELBOX_API_KEY
76+
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[0] }}
5077
- python-version: 3.12
5178
api-key: STAGING_LABELBOX_API_KEY_5
5279
da-test-key: DA_GCP_LABELBOX_API_KEY
@@ -55,6 +82,7 @@ jobs:
5582
python-version: ${{ matrix.python-version }}
5683
api-key: ${{ matrix.api-key }}
5784
da-test-key: ${{ matrix.da-test-key }}
85+
sdk-version: ${{ matrix.sdk-version }}
5886
fixture-profile: true
5987
test-env: 'staging'
6088
secrets: inherit

.github/workflows/python-package-shared.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
da-test-key:
1313
required: true
1414
type: string
15+
sdk-version:
16+
required: false
17+
type: string
1518
test-env:
1619
required: true
1720
type: string
@@ -41,7 +44,7 @@ jobs:
4144
steps:
4245
- uses: actions/checkout@v4
4346
with:
44-
ref: ${{ github.head_ref }}
47+
ref: ${{ inputs.sdk-version || github.head_ref }}
4548
- uses: ./.github/actions/python-package-shared-setup
4649
with:
4750
rye-version: ${{ vars.RYE_VERSION }}
@@ -61,7 +64,7 @@ jobs:
6164
steps:
6265
- uses: actions/checkout@v4
6366
with:
64-
ref: ${{ github.head_ref }}
67+
ref: ${{ inputs.sdk-version || github.head_ref }}
6568
- uses: ./.github/actions/python-package-shared-setup
6669
with:
6770
rye-version: ${{ vars.RYE_VERSION }}

.python-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.19
1+
3.8.18

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ members = ["libs/*", "examples"]
3535

3636
[tool.pytest.ini_options]
3737
# https://github.com/pytest-dev/pytest-rerunfailures/issues/99
38-
addopts = "-rP -vvv --reruns 1 --reruns-delay 5 --durations=20 -n auto --cov=labelbox --import-mode=importlib --order-group-scope=module"
38+
addopts = "-rP -vvv"
3939
markers = """
4040
slow: marks tests as slow (deselect with '-m "not slow"')
4141
"""

0 commit comments

Comments
 (0)