2021-02-01 07:16:55 +00:00
|
|
|
name: run tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python-version:
|
|
|
|
- "3.7"
|
|
|
|
- "3.8"
|
|
|
|
- "3.9"
|
2021-10-07 06:46:13 +00:00
|
|
|
- "3.10"
|
2023-03-26 10:47:38 +00:00
|
|
|
- "3.11"
|
2021-02-01 09:58:14 +00:00
|
|
|
# pypy fails in some cases but we don't care much about that
|
|
|
|
# with github actions we can't mark some jobs to not affect the overall
|
|
|
|
# conclusion so we have to omit "allow-failure" tests.
|
|
|
|
# See https://github.com/actions/toolkit/issues/399
|
|
|
|
# - pypy-3.7
|
2021-02-01 07:16:55 +00:00
|
|
|
deps:
|
|
|
|
- tornado pycurl
|
|
|
|
- aiohttp
|
|
|
|
- tornado
|
|
|
|
- httpx[http2]>=0.14.0
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-03-26 12:02:39 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-02-01 07:16:55 +00:00
|
|
|
- name: Setup Python ${{ matrix.python-version }}
|
2023-03-26 12:02:39 +00:00
|
|
|
uses: actions/setup-python@v4
|
2021-02-01 07:16:55 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Setup Cache
|
2023-03-26 12:02:39 +00:00
|
|
|
uses: actions/cache@v3
|
2021-02-01 07:16:55 +00:00
|
|
|
env:
|
|
|
|
cache-name: cache-pip
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
2022-02-22 20:57:47 +00:00
|
|
|
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.deps }}-${{ hashFiles('pyproject.toml', 'setup.cfg') }}
|
2021-02-01 07:16:55 +00:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.deps }}-
|
|
|
|
${{ runner.os }}-${{ env.cache-name }}-
|
|
|
|
- name: Install pycurl deps
|
|
|
|
if: ${{ contains(matrix.deps, 'pycurl') }}
|
2021-07-25 11:49:00 +00:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y libcurl4-openssl-dev
|
2022-04-02 04:03:45 +00:00
|
|
|
# werkzeug is pinned for httpbin compatibility https://github.com/postmanlabs/httpbin/issues/673
|
2021-02-01 07:16:55 +00:00
|
|
|
- name: Install Python deps
|
2023-02-01 15:08:09 +00:00
|
|
|
run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog tomli platformdirs lxml 'werkzeug<2.1' awesomeversion
|
2021-02-01 07:16:55 +00:00
|
|
|
- name: Decrypt keys
|
|
|
|
env:
|
|
|
|
KEY: ${{ secrets.KEY }}
|
|
|
|
run: if [[ -n $KEY ]]; then openssl enc -d -aes-256-ctr -pbkdf2 -k $KEY -in keyfile.toml.enc -out keyfile.toml; fi
|
|
|
|
- name: Run pytest
|
|
|
|
run: if [[ -f keyfile.toml ]]; then KEYFILE=keyfile.toml pytest; else pytest; fi
|