Convert from Travis to GitHub Actions

Signed-off-by: Dan Yeaw <dan@yeaw.me>
This commit is contained in:
Dan Yeaw 2019-11-23 15:00:25 -05:00
parent f9d9dcab6a
commit a9de71ac6e
No known key found for this signature in database
GPG Key ID: 77A923EF537B61A4
3 changed files with 50 additions and 45 deletions

48
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: build
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install pre-commit
pre-commit install-hooks
- name: Lint with pre-commit
run: |
pre-commit run --all-files
test:
needs: lint
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.0.0b3
poetry install
- name: Test with pytest
run: |
poetry run pytest --cov=generic
# - name: Code Climate Coverage Action
# uses: paambaati/codeclimate-action@v2.3.0
# env:
# CC_TEST_REPORTER_ID:
# with:
# coverageCommand: poetry run coverage xml

View File

@ -1,44 +0,0 @@
language: python
dist: xenial
cache: pip
stages:
- lint
- test
jobs:
include:
- python: 3.7
- python: 3.8
- stage: lint
python: 3.7
before_install: skip
install:
- pip install pre-commit
- pre-commit install-hooks
script:
- pre-commit run --all-files
after_success: skip
install:
- pip install poetry==1.0.0b3
- poetry install
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- pytest --cov=generic
after_script:
- coverage xml
- ./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $TRAVIS_TEST_RESULT
notifications:
email: false
webhooks:
urls:
- https://webhooks.gitter.im/e/1e0a1432c48a12660160
on_success: change
on_failure: always
on_start: never

View File

@ -1,6 +1,7 @@
# Generic programming library for Python
[![Build Status](https://travis-ci.org/gaphor/generic.svg?branch=master)](https://travis-ci.org/gaphor/generic)
[![Build Status](https://github.com/gaphor/generic)](https://travis-ci.org/gaphor/generic)
[![Build state](https://github.com/gaphor/generic/workflows/build/badge.svg)](https://github.com/gaphor/generic/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/c7be2d28400687b1375a/maintainability)](https://codeclimate.com/github/gaphor/generic/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/c7be2d28400687b1375a/test_coverage)](https://codeclimate.com/github/gaphor/generic/test_coverage)
[![Documentation Status](https://readthedocs.org/projects/generic/badge/?version=latest)](https://generic.readthedocs.io/en/latest/?badge=latest)