Skip to content

Commit 5156e09

Browse files
committed
testing changes
1 parent 9656721 commit 5156e09

1 file changed

Lines changed: 51 additions & 7 deletions

File tree

.github/workflows/publish-python-sdk.yml

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,58 @@ permissions:
1313
id-token: write
1414

1515
jobs:
16-
build:
16+
test:
1717
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v2
29+
with:
30+
cache: true
31+
32+
- name: Install dev dependencies with uv
33+
working-directory: python-sdk
34+
run: |
35+
uv sync --group dev
36+
37+
- name: Install python-sdk package (editable)
38+
working-directory: python-sdk
39+
run: |
40+
uv pip install -e .
41+
42+
- name: Run tests with pytest and coverage
43+
working-directory: python-sdk
44+
run: |
45+
uv run pytest --cov=exospherehost --cov-report=xml --cov-report=term-missing -v --junitxml=pytest-report.xml
46+
47+
- name: Upload coverage reports to Codecov
48+
uses: codecov/codecov-action@v5
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
slug: exospherehost/exospherehost
52+
files: python-sdk/coverage.xml
53+
flags: python-sdk-unittests
54+
name: python-sdk-coverage-report
55+
fail_ci_if_error: true
56+
57+
- name: Upload test results
58+
uses: actions/upload-artifact@v4
59+
if: always()
60+
with:
61+
name: python-sdk-test-results
62+
path: python-sdk/pytest-report.xml
63+
retention-days: 30
64+
65+
publish:
66+
runs-on: ubuntu-latest
67+
needs: test
1868
defaults:
1969
run:
2070
working-directory: python-sdk
@@ -29,12 +79,6 @@ jobs:
2979

3080
- run: uv sync --locked --dev
3181

32-
- name: Install package
33-
run: uv pip install -e .
34-
35-
- name: Run tests
36-
run: uvx --from pytest pytest -q
37-
3882
- run: uv build
3983

4084
- run: uv publish

0 commit comments

Comments
 (0)