name: websocket-client build and test

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        python-version: [3.7, 3.8, 3.9]
        os: [ubuntu-latest, windows-latest, macOS-latest]

    steps:
      - name: Check out source repository
        uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }} environment
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Run local websockets echo server on port ${{ env.LOCAL_WS_SERVER_PORT }} (code is for Python 3.7+)
        run: |
          pip3 install -U websockets asyncio
          python3 websocket/tests/echo-server.py &
      - name: Build websocket-client & run tests
        run: |
          pip3 install -U pip setuptools wheel readme_renderer twine pytest python-socks
          python3 -c "import setuptools; print('Setup tools version'); print(setuptools.__version__)"
          pytest websocket/tests -v -rP
          python3 setup.py sdist
          twine check dist/*
        env:
          TEST_WITH_INTERNET: 1
          LOCAL_WS_SERVER_PORT: 8765

name: websocket-client build and test

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        python-version: [3.7, 3.8, 3.9, 3.10]
        os: [ubuntu-latest, windows-latest, macOS-latest]

    steps:
      - name: Check out source repository
        uses: actions/checkout@v2
      - name: Set up Python ${{ matrix.python-version }} environment
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Run local websockets echo server on port ${{ env.LOCAL_WS_SERVER_PORT }} (code is for Python 3.7+)
        run: |
          pip3 install -U websockets asyncio
          python3 websocket/tests/echo-server.py &
      - name: Build websocket-client & run tests
        run: |
          pip3 install -U pip setuptools wheel readme_renderer twine pytest python-socks
          python3 -c "import setuptools; print('Setup tools version'); print(setuptools.__version__)"
          pytest websocket/tests -v -rP
          python3 setup.py sdist
          twine check dist/*
        env:
          TEST_WITH_INTERNET: 1
          LOCAL_WS_SERVER_PORT: 8765

Add Python 3.10 to GitHub Action CI
Add Python 3.10 to GitHub Action CI
