summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook.git@proton.me>2022-09-29 16:20:25 -0500
committerJordan Cook <jordan.cook.git@proton.me>2022-09-30 18:27:37 -0500
commit71798462b26f0f1b65b9df6b555c2a0185515483 (patch)
treecbfa48ddffa5f7ab1ed9a3dd550bde3f625b605d /.github
parentc567350d4e452a3cfd95647e7b17b973557105d0 (diff)
downloadrequests-cache-71798462b26f0f1b65b9df6b555c2a0185515483.tar.gz
Run pre-deploy unit tests for all supported combinations of platforms, python versions, and requests versions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/deploy.yml65
1 files changed, 30 insertions, 35 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 60839e5..694c757 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -23,18 +23,11 @@ env:
STRESS_TEST_MULTIPLIER: 7
jobs:
- # Run tests for all supported requests versions and minimum supported python version
- test:
+
+ # Run additional integration stress tests
+ test-stress:
runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: [3.7]
- requests-version: [2.22, 2.23, 2.24, 2.25, 2.26, 2.27, 2.28]
- # Run tests for most recent python and requests versions
- include:
- - python-version: '3.10'
- requests-version: latest
- fail-fast: false
+
services:
nginx:
image: kennethreitz/httpbin
@@ -46,7 +39,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
- python-version: ${{ matrix.python-version }}
+ python-version: ${{ env.LATEST_PY_VERSION }}
- uses: snok/install-poetry@v1.3
with:
virtualenvs-in-project: true
@@ -66,18 +59,14 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
- key: venv-${{ matrix.python-version }}-${{ matrix.requests-version }}-${{ hashFiles('poetry.lock') }}
+ key: venv-${{ env.LATEST_PY_VERSION }}-latest-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
- run: |
- poetry add requests@${{ matrix.requests-version }} --lock
- poetry install -v -E all
+ run: poetry install -v -E all
- # Run unit + integration tests
- - name: Run tests
- run: |
- source $VENV
- nox -e test-current
+ # Run tests
+ - name: Run stress tests
+ run: poetry run nox -e stress -- ${{ env.STRESS_TEST_MULTIPLIER }}
# Run unit tests without any optional dependencies installed
test-minimum-deps:
@@ -104,21 +93,26 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install -v
- - name: Run unit tests with no optional dependencies
- run: |
- source $VENV
- pytest -n auto tests/unit
+ # Run tests
+ - name: Run tests with no optional dependencies
+ run: poetry run pytest -n auto tests/unit
- # Run additional stress tests
- test-stress:
- runs-on: ubuntu-latest
+ # Run unit tests for all supported platforms, python versions, and requests versions
+ test:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ python-version: [3.7, 3.8, 3.9, '3.10']
+ requests-version: [2.22, 2.23, 2.24, 2.25, 2.26, 2.27, latest]
+ fail-fast: false
+ runs-on: ${{ matrix.os }}
steps:
# Set up python + poetry
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
- python-version: ${{ env.LATEST_PY_VERSION }}
+ python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1.3
with:
virtualenvs-in-project: true
@@ -129,15 +123,16 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
- key: venv-${{ env.LATEST_PY_VERSION }}-latest-${{ hashFiles('poetry.lock') }}
+ key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.requests-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
- run: poetry install -v -E all
-
- - name: Run stress tests
run: |
- source $VENV
- nox -e stress -- ${{ env.STRESS_TEST_MULTIPLIER }}
+ poetry add requests@${{ matrix.requests-version }} --lock
+ poetry install -v -E all
+
+ # Run tests
+ - name: Run tests
+ run: poetry run pytest -n auto tests/unit
# Deploy stable builds on tags only, and pre-release builds from manual trigger ("workflow_dispatch")
release: