switch tests from travis to github actions

because travis queues are too long.
This commit is contained in:
lilydjwg 2021-02-01 15:16:55 +08:00
parent d2a5a1bf79
commit 0114a411f2
3 changed files with 57 additions and 31 deletions

View file

@ -7,6 +7,16 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Cache
uses: actions/cache@v2
env:
cache-name: cache-pipmypy
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-cache-pip-
- name: Install deps
run: pip3 install -U tornado pytest pytest-asyncio pytest-httpbin flaky structlog toml aiohttp httpx mypy
- name: Run mypy

47
.github/workflows/tests.yaml vendored Normal file
View file

@ -0,0 +1,47 @@
name: run tests
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: ${{ contains(matrix.python-version, 'pypy') }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- pypy-3.7
deps:
- tornado pycurl
- aiohttp
- tornado
- httpx[http2]>=0.14.0
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Cache
uses: actions/cache@v2
env:
cache-name: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.deps }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.deps }}-
${{ runner.os }}-${{ env.cache-name }}-
- name: Install pycurl deps
if: ${{ contains(matrix.deps, 'pycurl') }}
run: sudo apt install -y libcurl4-openssl-dev
- name: Install Python deps
run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog toml appdirs
- 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

View file

@ -1,31 +0,0 @@
os: linux
dist: bionic
language: python
cache: pip
python:
- "3.7"
- "3.8"
- "3.9"
- "nightly"
before_install: if [[ -n $KEY ]]; then openssl enc -d -aes-256-ctr -pbkdf2 -k $KEY -in keyfile.toml.enc -out keyfile.toml; fi
install: pip install -U $DEPS pytest pytest-asyncio pytest-httpbin flaky structlog toml appdirs
script: if [[ -n $KEY ]]; then KEYFILE=keyfile.toml pytest; else pytest; fi
env:
global:
- secure: "t8ffqGkADmA8DQDnqswd/olWPM5smpibdkK67EwBy3fWwOpvWkEzmJm2ZLIF5JYRN8tG09v+54v0omHvhUrqmhTuR2wW6F9RgfeZhLfv12BW/XZCGBMW04oYPtROCWbEAFndaOBneh82suGjDtjgU+fKfUaAXLJBPFdJafLTnZaVcW/andLRpF1gEQDEfGg9Wqo7WMQjETeWQI6mXNkXmxtqKAMen7arPe18CiNMApf6ybLUnuTEyg4oi+1pgQ9sfSJqw/lYvWxIJe0ajBC+Izy9noaI+LqRITMj3zyX9c3yHMCRuJU+YUim+P58wHjpOOdhZFgIsadfkgmtLnkvXOihbGHUV6IVZ/ZroezJz8FiDg23L/z/iPKaSaKg3BvkNceS/UA8QZUCdGmM7C33iSi0JC/3jmdkip8MCCerfW5NkNT1a7V4uoEgnNPNeLYv8zYPMwVkGxwNckW2NJOhuY+R168Cfxye/Y0jydnT/jP4uZGWpVS8d0KDnl8qsX7O2ULX+E76CjCgdq7SM37tilhXbjH4bX/aaFpncOMWqw5YgpgYo9XIPZeiXIE8fjv/Eu1Ahxh7rv+bqP4SAICknRVIaLrzpVN3wYHMlDi93GoBisREe7nI78wvZxebI0NV+qvTII0Hak+hUJtDM6ujg/ZkqiEfppw9NonmHSgmQcE="
jobs:
- DEPS=aiohttp
- DEPS="tornado pycurl"
- DEPS=tornado
- DEPS="httpx[http2]>=0.14.0"
jobs:
fast_finish: true
allow_failures:
# it works now, but may be broken in the future again
- python: nightly
addons:
apt:
packages:
# This is needed for pycurl
- libgnutls28-dev