diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 20b1015b..3ebf4f9c 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -19,36 +19,51 @@ jobs: test: needs: pre-commit - runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9", "pypy3.10" ] + platform: [ + { os: 'ubuntu-latest', python-version: '3.8' }, + { os: 'ubuntu-latest', python-version: '3.9' }, + { os: 'ubuntu-latest', python-version: '3.10' }, + { os: 'ubuntu-latest', python-version: '3.11' }, + { os: 'ubuntu-latest', python-version: 'pypy3.8' }, + { os: 'ubuntu-latest', python-version: 'pypy3.9' }, + { os: 'ubuntu-latest', python-version: 'pypy3.10' }, + { os: 'macos-latest', python-version: '3.8' }, + { os: 'macos-latest', python-version: '3.9' }, + { os: 'macos-latest', python-version: '3.10' }, + { os: 'macos-latest', python-version: '3.11' }, + { os: 'macos-latest', python-version: 'pypy3.8' }, + { os: 'macos-latest', python-version: 'pypy3.9' }, + { os: 'macos-latest', python-version: 'pypy3.10' }, + { os: 'windows-latest', python-version: '3.8' }, + { os: 'windows-latest', python-version: '3.9' }, + { os: 'windows-latest', python-version: '3.10' }, + { os: 'windows-latest', python-version: '3.11' }, + ] # https://endoflife.date/python + runs-on: ${{ matrix.platform.os }} steps: - uses: actions/checkout@v3 - - name: Start httpbin server + - name: Wake up httpbin server run: | - docker run -d -p 9876:80 kennethreitz/httpbin + curl https://httpbinx.fly.dev/ip - name: Install poetry run: pipx install poetry - - name: Setup Python ${{ matrix.python-version }} + - name: Setup Python ${{ matrix.platform.python-version }} on ${{ matrix.platform.os }} uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.platform.python-version }} cache: 'poetry' - name: Install dependencies run: | poetry install --extras 'aiohttp' - - name: Ensure httpbin server is running - run: | - while true; do response=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:9876/get); if [ "$response" = "200" ]; then echo "HTTP 200 OK received"; break; else echo "Retrying..."; sleep 1; fi; done - - name: Echo installed packages run: | poetry show @@ -57,7 +72,7 @@ jobs: run: poetry run pytest -v -rs tests --runslow --cov=./ --cov-report=xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.11' + if: matrix.platform.python-version == '3.11' && matrix.platform.os == 'ubuntu-latest' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/__init__.py b/tests/__init__.py index 6131643d..85c77a6f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,2 @@ -import os - -HTTPBIN_URL = "https://httpbin.org/" -if os.getenv("GITHUB_ACTIONS"): - print("Running on Github Actions") - HTTPBIN_URL = "http://127.0.0.1:9876/" +# HTTPBIN_URL = "https://httpbin.org/" # see https://github.com/postmanlabs/httpbin/issues/613 +HTTPBIN_URL = "https://httpbinx.fly.dev/"