diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..f82df14b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,96 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + lint: + runs-on: ubuntu-20.04 + env: + TOXENV: "lint, newsfragment" + + steps: + - uses: actions/checkout@v2 + with: + # Need history on all branches for newsfragment to work. + fetch-depth: 0 + + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: + ${{ runner.os }}-pip-lint-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-lint- + ${{ runner.os }}-pip- + + - run: python -m pip install tox + + - run: tox -e flake8 + + - run: tox -e newsfragment + + - run: tox -e twine + + - run: tox -e check-manifest + + + docs: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: "3.8" + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: + ${{ runner.os }}-pip-docs-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-docs- + ${{ runner.os }}-pip- + + - run: python -m pip install tox + + - run: tox -e docs + + + test: + runs-on: ubuntu-20.04 + env: + TOXENV: "alldeps-withcov-posix,coverage-prepare,codecov-push,coveralls-push" + strategy: + matrix: + python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "pypy-2.7", "pypy-3.7"] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: + ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.py', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-pip- + + - run: python -m pip install tox + + - name: Test + run: tox -q