Also handle EBADF in the write path. #351
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: Build & Test Python Wheels | |
| on: | |
| push: | |
| # branches: [ master ] | |
| pull_request: | |
| # branches: [ master ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-22.04] | |
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Define PYTHON_CMD | |
| run: | | |
| PYTHON_VER="`echo ${{ matrix.python-version }} | sed 's|-dev$||'`" | |
| echo "PYTHON_CMD=python${PYTHON_VER}" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: | | |
| ${PYTHON_CMD} -m pip install --upgrade pip | |
| pip install --upgrade setuptools wheel | |
| pip install -r requirements.txt | |
| - name: Build, Install & Test | |
| run: | | |
| ${PYTHON_CMD} setup.py build | |
| ${PYTHON_CMD} setup.py sdist | |
| sudo "`which ${PYTHON_CMD}`" setup.py install | |
| pip install dist/sippy*.gz | |
| ${PYTHON_CMD} -m unittest | |
| set_env: | |
| uses: sippy/cimagic/.github/workflows/GetContainerPlatforms.yml@wip | |
| with: | |
| image: sippylabs/rtpproxy:latest | |
| voiptests: | |
| runs-on: ubuntu-latest | |
| needs: [set_env, build] | |
| env: | |
| BASE_IMAGE: sippylabs/rtpproxy:latest | |
| TARGETPLATFORM: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: ${{ fromJSON(needs.set_env.outputs.build-matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout VoIPTests repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'sippy/voiptests' | |
| path: dist/voiptests | |
| - name: Checkout RTPProxy repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'sippy/rtpproxy' | |
| path: dist/rtpproxy | |
| - name: Set up QEMU | |
| if: matrix.platform != 'linux/386' && matrix.platform != 'linux/amd64' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: ${{ env.TARGETPLATFORM }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: VoIP Tests | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.voiptests | |
| build-args: | | |
| RTPPC_TYPE=unix | |
| BASE_IMAGE=${{ env.BASE_IMAGE }} | |
| platforms: ${{ env.TARGETPLATFORM }} | |
| publish_wheels: | |
| needs: [build, voiptests] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/sippy | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade setuptools wheel | |
| pip install -r requirements.txt | |
| - name: build | |
| run: python setup.py build sdist | |
| - name: Publish package distributions to PyPI | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| roll_release: | |
| needs: [publish_wheels] | |
| permissions: | |
| contents: write | |
| uses: sippy/cimagic/.github/workflows/RollReleaseDraft.yml@v1 |