Skip to content

Commit

Permalink
chore: integrates with GithubActions and CodeClimate
Browse files Browse the repository at this point in the history
  • Loading branch information
vinyguedess committed May 8, 2020
1 parent 27b5b73 commit 9c78d2d
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/citest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: OnAny CI Test

on:
push:
branches:
- master
- 'feat/*'
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Prepare CodeClimate report
run: |
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
-O cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run tests
run: |
pip install coverage
make citest
- name: Code Climate Coverage Report
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
./cc-test-reporter after-build
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: OnAny Deploy

on:
release:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
run: |
pip install coverage
make citest
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ test:
coverage run -m unittest discover
coverage html
coverage report

citest:
coverage run -m unittest discover
coverage xml
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
OnAny... thing happening
========================

.. image:: https://github.com/vinyguedess/onany/workflows/OnAny%20CI%20Test/badge.svg
:target: https://github.com/vinyguedess/onany/actions?query=workflow%3A%22OnAny+CI+Test%22
:alt: Build

.. image:: https://api.codeclimate.com/v1/badges/c9f11d97d33668424612/maintainability
:target: https://codeclimate.com/github/vinyguedess/onany/maintainability
:alt: Maintainability

.. image:: https://api.codeclimate.com/v1/badges/c9f11d97d33668424612/test_coverage
:target: https://codeclimate.com/github/vinyguedess/onany/test_coverage
:alt: Test Coverage


OnAny is a simple yet powerful event manager library, where you can declare listeners and dispatch as much events as needed to them.

How To
Expand Down

0 comments on commit 9c78d2d

Please sign in to comment.