Skip to content

Commit

Permalink
Merge cc7b8de into 78b305a
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaref committed Oct 16, 2020
2 parents 78b305a + cc7b8de commit e302e9c
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 8 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
env:
USING_COVERAGE: '3.6,3.8'

strategy:
matrix:
python-version: ["2.7","3.6","3.7","3.8","3.9","pypy3"]

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
pip install -r requirements.txt
- name: "Run unit tests for tox ${{ matrix.python-version }}"
run: |
python -m tox
pip install pytest
py.test tests
# ensure Dev env works everywhere
install-dev:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]

name: "Verify dev env"
runs-on: "${{ matrix.os }}"
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.9"
- name: "Install in dev mode"
run: "python -m pip install -e .[dev]"
- name: "Import package"
run: "python -c 'import structlog; print(structlog.__version__)'"
25 changes: 17 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py3
envlist = py27, py36, py37, py38, py39, mypy

[gh-actions]
python =
2.7: py27
3.6: py36
3.7: py37
3.8: py38, docs
3.9: py39, lint, manifest
pypy3: pypy3

[testenv]
;commands = {envpython} setup.py test
deps =
requests
pytest
coverage
pytest-cov
setenv=
PYTHONWARNINGS=all
commands = pytest

[pytest]
adopts=--doctest-modules
addopts=--doctest-modules --ignore=setup.py
python_files=*.py
python_functions=test_
norecursedirs=.tox .git
norecursedirs=.tox .git .eggs

[testenv:py27]
basepython=python2.7
Expand All @@ -33,11 +42,11 @@ commands=
py.test tests --doctest-module --cov=. --cov-report term

[testenv:py3]
basepython=python3
basepython=python3.9
commands=
py.test tests --doctest-module
py.test tests --doctest-modules

[testenv:py3verbose]
basepython=python3
basepython=python3.9
commands=
py.test tests --doctest-module --cov=. --cov-report term
py.test tests --doctest-modules --cov=. --cov-report term

0 comments on commit e302e9c

Please sign in to comment.