From 30a4e0a34c9b3664a4d3b205d9620800571be3e0 Mon Sep 17 00:00:00 2001 From: Tim Nicholls Date: Wed, 24 Mar 2021 16:31:45 +0000 Subject: [PATCH] Implemented CI workflow in GH actions, including tox build matrix, codecov coverage reporting and Slack notification --- .codecov.yml | 5 +++ .travis.yml => .disable-travis.yml | 0 .github/workflows/test_odin_control.yml | 49 +++++++++++++++++++++++++ README.md | 11 ++---- tox.ini | 14 +++---- 5 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 .codecov.yml rename .travis.yml => .disable-travis.yml (100%) create mode 100644 .github/workflows/test_odin_control.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..5fbfac68 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,5 @@ +coverage: + notify: + slack: + default: + url: "secret:p86vG6xzWKglCbWuYQtBSGejyP2W0udsB8gacjwScz8BnSZTcfbIi6nkmJQU+62KZW7P2ZfJujXWYrm0OwPfSKHx4hFPm9QR+/qZBliA3ENlTiwDzNqZo6MpvClJnPksptVkM38KrjWbkXD4psXEsU34hhGca6NNCrwK6+oP98Y=" \ No newline at end of file diff --git a/.travis.yml b/.disable-travis.yml similarity index 100% rename from .travis.yml rename to .disable-travis.yml diff --git a/.github/workflows/test_odin_control.yml b/.github/workflows/test_odin_control.yml new file mode 100644 index 00000000..98473a29 --- /dev/null +++ b/.github/workflows/test_odin_control.yml @@ -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 }} \ No newline at end of file diff --git a/README.md b/README.md index 4cd5f15b..541367ea 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file diff --git a/tox.ini b/tox.ini index 65598ef3..bb50c8c3 100644 --- a/tox.ini +++ b/tox.ini @@ -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 = @@ -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}