Skip to content

Commit

Permalink
Travis -> GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Apr 18, 2021
1 parent 740af18 commit 70cbdef
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 20 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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/*"
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 70cbdef

Please sign in to comment.