diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..7db4a00f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,68 @@ +--- +name: CI + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +jobs: + tests: + name: "Python ${{ matrix.python-version }}" + runs-on: "ubuntu-latest" + env: + USING_COVERAGE: "3.6,3.7,3.8,3.9" + + strategy: + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9"] + + 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 wheel poetry + python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions + - name: "Run tox targets for ${{ matrix.python-version }}" + run: "python -m tox" + + # We always use a modern Python version for combining coverage to prevent + # parsing errors in older versions for modern code. + - uses: "actions/setup-python@v2" + with: + python-version: "3.9" + + - name: "Upload coverage to Codecov" + if: "contains(env.USING_COVERAGE, matrix.python-version)" + uses: "codecov/codecov-action@v1" + with: + fail_ci_if_error: true + + package: + name: "Build & verify package" + runs-on: "ubuntu-latest" + + steps: + - uses: "actions/checkout@v2" + - uses: "actions/setup-python@v2" + with: + python-version: "3.9" + + - name: "Install poetry, check-wheel-content, and twine" + run: "python -m pip install twine check-wheel-contents" + - name: "Build package" + run: "python setup.py sdist bdist_wheel" + - name: "List result" + run: "ls -l dist" + - name: "Check wheel contents" + run: "check-wheel-contents dist/*.whl" + - name: "Check long_description" + run: "python -m twine check dist/*" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a19d5d73..00000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: python - -matrix: - include: - - python: 3.6 - env: TOX_ENV=py36 - - python: 3.7 - env: TOX_ENV=py37 - - python: 3.8 - env: TOX_ENV=py38 - - python: 3.9-dev - env: TOX_ENV=py39 - -install: pip install tox-travis coveralls - -script: tox -e $TOX_ENV - -after_success: - - tox -e coverage-report - - coveralls diff --git a/tox.ini b/tox.ini index f739cc51..c61bd4c0 100644 --- a/tox.ini +++ b/tox.ini @@ -13,3 +13,11 @@ skip_install = true commands = coverage combine coverage report + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39, lint + pypy3: pypy3