Repository navigation
Add unit test for the TCPProxy as well. #460
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 & Publush | |
| # Controls when the action will run. | |
| on: | |
| # Triggers the workflow on all push or pull request events | |
| push: | |
| pull_request: | |
| release: | |
| types: [published] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| # added using https://github.com/step-security/secure-repo | |
| permissions: | |
| contents: read | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| build_test_python: | |
| name: Build&Test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15-dev'] | |
| compiler: ['gcc', 'clang'] | |
| os: [macos, ubuntu] | |
| # include: | |
| # Would be cool, but not yet :(. Someone, please make a PR. | |
| # - python-version: '3.10' | |
| # compiler: microsoft | |
| # os: windows | |
| # - python-version: '3.11' | |
| # compiler: microsoft | |
| # os: windows | |
| # - python-version: '3.12' | |
| # compiler: microsoft | |
| # os: windows | |
| runs-on: ${{ matrix.os }}-latest | |
| env: | |
| COMPILER: ${{ matrix.compiler }} | |
| MACOSX_DEPLOYMENT_TARGET: "11.0" | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| env: | |
| PIP_NO_CACHE_DIR: 1 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade build setuptools wheel | |
| if [ "${RUNNER_OS}" = "Linux" ]; then | |
| pip install --upgrade auditwheel | |
| fi | |
| shell: bash | |
| - name: build | |
| run: | | |
| python setup.py sdist | |
| CC=${COMPILER} LDSHARED="${COMPILER} -shared" python setup.py build | |
| python -m build --wheel | |
| if [ "${RUNNER_OS}" = "Linux" ]; then | |
| auditwheel repair dist/*.whl --wheel-dir dist/ | |
| fi | |
| shell: bash | |
| - name: install | |
| run: pip install dist/*.gz | |
| shell: bash | |
| - name: test | |
| run: | | |
| pip install --upgrade -r tests/requirements.txt | |
| python -m unittest discover -v -s tests -p '*.py' | |
| shell: bash | |
| build_wheels: | |
| name: Build Python Wheels | |
| permissions: | |
| packages: write | |
| needs: build_test_python | |
| uses: sippy/cimagic/.github/workflows/BuildPythonWheels.yml@v3 | |
| publish_all_wheels: | |
| name: Publish Python Wheels | |
| runs-on: ubuntu-latest | |
| needs: build_wheels | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/asyncproxy | |
| permissions: | |
| actions: read | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download all wheel artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| pattern: 'dist-*' | |
| merge-multiple: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade build setuptools | |
| - name: Build SDist | |
| run: | | |
| python setup.py sdist | |
| - name: Show context tree | |
| run: ls -lR dist | |
| - 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: | |
| name: Release | |
| needs: publish_all_wheels | |
| permissions: | |
| contents: write | |
| uses: sippy/cimagic/.github/workflows/RollReleaseDraft.yml@v3 |