Skip to content

Commit

Permalink
Run tests using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Oct 17, 2022
1 parent bfa22c2 commit 00e0a2e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 83 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -9,7 +9,6 @@ defaults:
jobs:
package:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: "Checkout repository"
Expand All @@ -27,3 +26,35 @@ jobs:
python -m pip install -U setuptools wheel twine
python setup.py sdist bdist_wheel
python -m twine check --strict dist/*
test:
strategy:
fail-fast: false
matrix:
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]
os:
- macos-latest
- windows-latest
- ubuntu-latest

runs-on: ${{ matrix.os }}
name: ${{ fromJson('{"macos-latest":"macOS","windows-latest":"Windows","ubuntu-latest":"Ubuntu"}')[matrix.os] }} ${{ matrix.python-version }}
steps:
- name: "Checkout repository"
uses: "actions/checkout@v3"

- name: "Setup Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v3"
with:
python-version: ${{ matrix.python-version }}
# Fails on Python 2 + Windows
# cache: "pip"
# cache-dependency-path: '**/setup.py'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
78 changes: 0 additions & 78 deletions .travis.yml

This file was deleted.

16 changes: 12 additions & 4 deletions tox.ini
@@ -1,5 +1,13 @@
[tox]
envlist = py27,py34,py35,py36,py37,pypy,pypy3,{py27,py34}-flake8,noopenssl,docstrings
envlist = py27,py37,py38,py39,py310,pypy,pypy3,{py27,py37}-flake8,noopenssl,docstrings

[gh-actions]
python =
2.7: py27
3.7: py37, py37-flake8, noopenssl
3.8: py38
3.9: py39
3.10: py310

[testenv]
pip_pre = False
Expand All @@ -14,7 +22,7 @@ commands =
py.test {posargs}

[testenv:noopenssl]
basepython = python3.6
basepython = python3.7
pip_pre = False
deps =
requests{env:REQUESTS_VERSION:>=2.0.1,<3.0.0}
Expand All @@ -30,8 +38,8 @@ deps =
flake8
commands = flake8 {posargs} requests_toolbelt

[testenv:py34-flake8]
basepython = python3.4
[testenv:py37-flake8]
basepython = python3.7
deps =
flake8
commands = flake8 {posargs} requests_toolbelt
Expand Down

0 comments on commit 00e0a2e

Please sign in to comment.