@@ -3,129 +3,26 @@ name: Build, Test and Publish ITL ControlPlane SDK
33on :
44 workflow_dispatch :
55 inputs :
6- environment :
7- description : ' Environment to deploy to'
8- required : false
9- default : ' staging'
10- type : choice
11- options :
12- - staging
13- - production
14- force_rebuild :
15- description : ' Force rebuild package (ignore cache)'
16- required : false
17- default : false
18- type : boolean
19- skip_tests :
20- description : ' Skip package tests'
21- required : false
22- default : false
23- type : boolean
246 publish_pypi :
25- description : ' Publish to PyPI (production only) '
7+ description : ' Publish to PyPI'
268 required : false
279 default : true
2810 type : boolean
2911 push :
30- branches :
31- - main
32- - develop
33- - ' feature/**'
3412 tags :
3513 - " v*"
3614 paths :
3715 - ' src/**'
3816 - ' pyproject.toml'
3917 - ' README.md'
4018 - ' LICENSE'
41- - ' examples/**'
42- - ' providers/**'
4319 - ' .github/workflows/**'
44- pull_request :
45- branches : [ main, develop ]
46- paths :
47- - ' src/**'
48- - ' pyproject.toml'
49- - ' README.md'
50- - ' LICENSE'
51- - ' examples/**'
52- - ' providers/**'
5320
5421env :
5522 PACKAGE_NAME : itl-controlplane-sdk
5623 PYTHON_VERSION : ' 3.11'
5724
5825jobs :
59- # Test and validate package
60- test :
61- runs-on : ubuntu-latest
62- if : ${{ !inputs.skip_tests }}
63- strategy :
64- matrix :
65- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12']
66-
67- steps :
68- - name : Checkout repository
69- uses : actions/checkout@v4
70-
71- - name : Set up Python ${{ matrix.python-version }}
72- uses : actions/setup-python@v4
73- with :
74- python-version : ${{ matrix.python-version }}
75-
76- - name : Cache Python dependencies
77- uses : actions/cache@v3
78- with :
79- path : ~/.cache/pip
80- key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
81- restore-keys : |
82- ${{ runner.os }}-pip-${{ matrix.python-version }}-
83- ${{ runner.os }}-pip-
84-
85- - name : Install package and dependencies
86- run : |
87- python -m pip install --upgrade pip
88- pip install -e ".[dev]"
89-
90- - name : Run SDK validation tests
91- run : |
92- python test_sdk.py
93-
94- - name : Run pytest (if tests exist)
95- run : |
96- if [ -d "tests" ]; then
97- pytest tests/ -v
98- else
99- echo "No pytest directory found, skipping pytest"
100- fi
101-
102- - name : Run type checking with mypy
103- run : |
104- mypy src/itl_controlplane_sdk --ignore-missing-imports
105-
106- - name : Run code formatting check
107- run : |
108- black --check src/ examples/ providers/
109-
110- - name : Test import and basic functionality
111- run : |
112- python -c "
113- from itl_controlplane_sdk import ResourceProviderRegistry, ResourceProvider
114- from itl_controlplane_sdk.models import ResourceRequest, ProvisioningState
115- print('✅ All imports successful')
116-
117- # Test basic functionality
118- registry = ResourceProviderRegistry()
119- print('✅ Registry creation successful')
120-
121- print('🎉 SDK basic functionality test passed')
122- "
123-
124- - name : Test example scripts
125- run : |
126- cd examples
127- python quickstart.py
128-
12926 # Lint and security checks
13027 lint-and-security :
13128 runs-on : ubuntu-latest
17774 build :
17875 needs : [lint-and-security]
17976 runs-on : ubuntu-latest
180- if : ${{ always() && (needs.lint-and-security.result == 'success') && (!inputs.skip_tests || needs.test.result == 'success' || needs.test.result == 'skipped') }}
77+ if : ${{ always() && (needs.lint-and-security.result == 'success') }}
18178
18279 outputs :
18380 package-version : ${{ steps.version.outputs.version }}
@@ -374,9 +271,9 @@ jobs:
374271
375272 # Publish to PyPI (Test)
376273 publish-test :
377- needs : [build, test ]
274+ needs : [build]
378275 runs-on : ubuntu-latest
379- if : ${{ always() && needs.build.result == 'success' && needs.test.result == 'success' }}
276+ if : ${{ always() && needs.build.result == 'success' }}
380277 environment : staging
381278
382279 steps :
@@ -575,14 +472,12 @@ jobs:
575472
576473 # Auto-create release tags on push to main/develop
577474 auto-tag :
578- needs : [test, build]
475+ needs : [build]
579476 runs-on : ubuntu-latest
580477 if : |
581478 github.event_name == 'push' &&
582479 !startsWith(github.ref, 'refs/tags/') &&
583- (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') &&
584- needs.test.result == 'success' &&
585- needs.build.result == 'success'
480+ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
586481 permissions :
587482 contents : write
588483
@@ -723,13 +618,13 @@ jobs:
723618
724619 # Notify on completion
725620 notify :
726- needs : [test, build, publish-test, publish-production, create-release, auto-tag]
621+ needs : [build, publish-test, publish-production, create-release, auto-tag]
727622 runs-on : ubuntu-latest
728623 if : always()
729624 steps :
730625 - name : Determine notification status
731626 run : |
732- if [[ "${{ needs.test.result }}" == "success" && "${{ needs. build.result }}" == "success" ]]; then
627+ if [[ "${{ needs.build.result }}" == "success" ]]; then
733628 if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
734629 if [[ "${{ needs.publish-production.result }}" == "success" ]]; then
735630 echo "STATUS=✅ PRODUCTION RELEASE SUCCESSFUL" >> $GITHUB_ENV
0 commit comments