handle-blank-response-202 (#949) #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| python-version: | |
| description: "Python version to test with (or 'all' for full matrix)" | |
| required: false | |
| default: "all" | |
| schedule: | |
| - cron: '30 3 * * 1' # Monday 9AM IST | |
| env: | |
| ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} | |
| jobs: | |
| lockfile-hygiene: | |
| runs-on: ubuntu-x64 | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: twilio/sdk-actions/uv-lockfile-hygiene@23b656b843d2a3461cf38e4fd466c07a822d5fc0 # v1 | |
| with: | |
| clean-room: 'false' | |
| test: | |
| name: Test - Python ${{ matrix.python-version }} | |
| needs: [lockfile-hygiene] | |
| runs-on: ubuntu-x64 | |
| if: github.repository_owner == 'twilio' | |
| # make docs takes ~15mins | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ (github.event_name == 'schedule' || github.event.inputs.python-version == 'all') && fromJson('["3.8","3.9","3.10","3.11","3.12","3.13"]') || fromJson(format('["{0}"]', github.event.inputs.python-version || '3.12')) }} | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Artifactory OIDC Auth | |
| uses: twilio/sdk-actions/artifactory-oidc@23b656b843d2a3461cf38e4fd466c07a822d5fc0 # v1 | |
| with: | |
| ecosystem: python | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install virtualenv --upgrade | |
| make install test-install | |
| make prettier | |
| - name: Run tests | |
| run: make test-with-coverage | |
| - name: Run cluster tests | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| env: | |
| TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} | |
| TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY }} | |
| TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} | |
| TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} | |
| TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} | |
| TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} | |
| ASSISTANT_ID: ${{ secrets.ASSISTANT_ID }} | |
| run: make cluster-test | |
| - name: Verify docs generation | |
| run: make docs | |
| deploy-dry-run: | |
| name: Release Readiness Check - Build artifact | |
| needs: [test] | |
| runs-on: ubuntu-x64 | |
| if: github.repository_owner == 'twilio' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Artifactory OIDC Auth | |
| uses: twilio/sdk-actions/artifactory-oidc@23b656b843d2a3461cf38e4fd466c07a822d5fc0 # v1 | |
| with: | |
| ecosystem: python | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install setuptools | |
| run: pip install setuptools | |
| - name: Validate version format | |
| run: | | |
| PKG_VERSION=$(python setup.py --version) | |
| echo "Package version: $PKG_VERSION" | |
| echo "PKG_VERSION=$PKG_VERSION" >> "$GITHUB_ENV" | |
| if [[ ! "$PKG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then | |
| echo "::error::setup.py version must follow semver (got '$PKG_VERSION')" | |
| exit 1 | |
| fi | |
| - name: Build package | |
| run: | | |
| pip install build | |
| python -m build | |
| - name: Verify package | |
| run: | | |
| pip install twine | |
| twine check dist/* | |
| - name: List built artifacts | |
| run: | | |
| echo "Built artifacts:" | |
| ls -lh dist/ | |
| echo "" | |
| echo "Package version: $PKG_VERSION" | |
| - name: Dry run summary | |
| run: | | |
| echo "--- DRY RUN COMPLETE ---" | |
| echo "All pre-release steps passed for version $PKG_VERSION" | |