Skip to content

Instantly share code, notes, and snippets.

@Zac-HD
Created August 18, 2021 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zac-HD/bd35cbd30cb1d28355e02a3e6eaa20bb to your computer and use it in GitHub Desktop.
Save Zac-HD/bd35cbd30cb1d28355e02a3e6eaa20bb to your computer and use it in GitHub Desktop.
Zac's simple CI setup
name: Project CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
run-tox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox
python -m tox --notest --recreate
- name: Run checks
run: |
python -m tox
git diff --exit-code
# The test environment and commands
[tox]
skipsdist = True
[testenv:check]
description = Runs all formatting tools then static analysis (quick)
deps =
flake8
flake8-bandit
flake8-bugbear
flake8-comprehensions
flake8-docstrings
shed
commands =
shed
flake8
[testenv:test]
description = Runs your logical tests (slower)
deps =
hypothesis
pytest
pytest-cov
pytest-xdist
commands =
pytest {posargs:-n auto}
# Settings for other tools
[pytest]
addopts =
-Werror
--tb=short
# Uncomment these lines to see coverage information for your tests
#--cov=hypothesmith
#--cov-branch
#--cov-report=term-missing:skip-covered
#--cov-fail-under=100
[flake8]
ignore = D1,E501,W503,S101,S310
exclude = .*,__pycache__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment