Skip to content

Commit

Permalink
Implemented CI workflow in GH actions, including tox build matrix,
Browse files Browse the repository at this point in the history
codecov coverage reporting and Slack notification
  • Loading branch information
timcnicholls committed Mar 25, 2021
1 parent 9859dd6 commit 30a4e0a
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage:
notify:
slack:
default:
url: "secret:p86vG6xzWKglCbWuYQtBSGejyP2W0udsB8gacjwScz8BnSZTcfbIi6nkmJQU+62KZW7P2ZfJujXWYrm0OwPfSKHx4hFPm9QR+/qZBliA3ENlTiwDzNqZo6MpvClJnPksptVkM38KrjWbkXD4psXEsU34hhGca6NNCrwK6+oP98Y="
File renamed without changes.
49 changes: 49 additions & 0 deletions .github/workflows/test_odin_control.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test odin-control

on:
- push
- pull_request

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

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions coverage
- name: Test with tox
run: tox
- name: Merge tox env specific coverage files
run: |
coverage combine
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: ${{ matrix.python-version }}
fail_ci_if_error: true

notify:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: build_and_test
steps:
- name: Slack Notification on completion
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: odin-control-notify
SLACK_COLOR: ${{ needs.build_and_test.result }}
SLACK_ICON: https://avatars.githubusercontent.com/odin-detector?size=48
SLACK_TITLE: "odin-control CI tests completed: ${{ needs.build_and_test.result }}"
SLACK_USERNAME: odin-detector
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# odin
Prototype of ODIN framework for evaluation purposes only
# odin-control

[![Build Status](https://travis-ci.org/odin-detector/odin-control.svg)](https://travis-ci.org/odin-detector/odin-control)
[![Coverage Status](https://coveralls.io/repos/github/odin-detector/odin-control/badge.svg?branch=master)](https://coveralls.io/github/odin-detector/odin-control?branch=master)
[![Stories in Ready](https://badge.waffle.io/odin-detector/odin-control.png?label=ready&title=Ready)](https://waffle.io/odin-detector/odin-control)
[![Stories in In Progress](https://badge.waffle.io/odin-detector/odin-control.png?label=In%20Progress&title=In%20Progress)](https://waffle.io/odin-detector/odin-control)
[![Code Climate](https://codeclimate.com/github/odin-detector/odin-control/badges/gpa.svg)](https://codeclimate.com/github/odin-detector/odin-control)
[![Test Coverage](https://codeclimate.com/github/odin-detector/odin-control/badges/coverage.svg)](https://codeclimate.com/github/odin-detector/odin-control/coverage)
[![Test odin-control](https://github.com/odin-detector/odin-control/actions/workflows/test_odin_control.yml/badge.svg)](https://github.com/odin-detector/odin-control/actions/workflows/test_odin_control.yml)
[![codecov](https://codecov.io/gh/odin-detector/odin-control/branch/master/graph/badge.svg?token=Urucx8wsTU)](https://codecov.io/gh/odin-detector/odin-control)
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
[tox]
envlist = clean,py27-tornado{4,5},py{36,37,38,39}-tornado{5,6},report

[travis]
[gh-actions]
python =
2.7: py27
3.6: py36
3.7: py37
3.8: py38
3.9: py39, clean, report
2.7: py27
3.6: py36
3.7: py37
3.8: py38
3.9: py39

[testenv]
deps =
Expand All @@ -27,7 +27,7 @@ deps =
setenv =
py{27,36,37,38,39}: COVERAGE_FILE=.coverage.{envname}
commands =
pytest --cov=odin {posargs:-vv}
pytest --cov=odin --cov-report=term-missing {posargs:-vv}
depends =
py{27,36,37,38,39}: clean
report: py{27,36,37,38,39}
Expand Down

0 comments on commit 30a4e0a

Please sign in to comment.