Repository: chaostoolkit/chaostoolkit-lib (language: python)

Issue:
Travis is slow to build. Consider moving to GitHub action
**Describe the bug**
TravisCI has become unreliable. We have now to move away from it.

**Additional context**
Let's move to GitHub action as faster and more reliable.



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 0000000..188090e
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,42 @@
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    runs-on: ubuntu-16.04
+    strategy:
+      matrix:
+        python-version: [3.5, 3.6, 3.7, 3.8]
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v1
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip setuptools wheel
+        pip install -r requirements.txt -r requirements-dev.txt
+    - name: Checking the code syntax
+      run: |
+        pycodestyle --first chaoslib
+    - name: Run tests
+      run: |
+        pip install -e .
+        pytest tests/
+
+  build:
+    runs-on: ubuntu-16.04
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python
+      uses: actions/setup-python@v1
+      with:
+        python-version: '3.5'
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip setuptools wheel
+    - name: Build the choastoolkit-lib package
+      run : |
+        python3 setup.py build
\ No newline at end of file
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..e69de29
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e5dac4b..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-language: python
-
-matrix:
-  include:
-  - os: linux
-    dist: trusty
-    python: 3.5
-  - os: linux
-    dist: trusty
-    python: 3.6
-  - os: linux
-    dist: xenial
-    python: 3.7
-  - os: linux
-    dist: xenial
-    python: 3.8
-
-before_install: |
-  if [ "$TRAVIS_OS_NAME" == "osx" ]; then
-    brew upgrade python3
-    python3 --version
-    python3 -m pip install -U pip
-    which pip3
-  fi
-
-install:
-  - pip3 install -r requirements.txt -r requirements-dev.txt
-  - pip3 install -U codecov
-
-env:
-  global:
-  - secure: "AMgOQ88RW5w0KVCrMBKPYogDPBFhBKBm2zIcJEzGi+fBVyhLvEz1X3+vOBt5rvxWIxzvObKMbdT2Nny4I2xNrHMqLiTNHU9ovT81rgfRa/VkgmxVWtjXz1Eu8xfFhL5suE+xVBvDKOM34ik9VunJs+Pnp2SlZACeOtaWuiyG+375g14VuUERVZy0wKaH0nBhYKp6WAugFZCDoFyw/FIdstRauAZQaT41Xy3oeFMsHDeXixDh/CFr7N1rnjgJ6GJiGRhHPaeNM7rP4B73yEIPvRXuDNAG3wS0bBd3sSWudId/g6BiZK5asOd7cJ0dpXLlsQ+AmbN5RIMMpIgw5t1E4ivI1iV/JEJ6Wohm7d7/K/I3yK3VcXd7ZVhFwpdarNq+6kcnfdQZpo0rd9arCoEAgYREQFigYeS1fnok5eYCJf4a+jaxAZSpIoipPJGUtnlUYvqezSULIfD4d5N26BN2gHOKnjdhs21tSqXh25j+HWcPjXfy3BH8cG1kkpZv9CguEZhIHnRU7jjrLHFjf+0PbTuHpxbB0AmVcnnYcPXwIpHbQqsdLGiMH+6Un3GS6EjalXB1ZxWu+hdlX0BuapR7cNYINZdi3uqp78MeTlsaYIl47vLMuRI3YpZVPxdN55xXdbiHZuIeX+gB6LaFiiCe6PAXv6kPJdGfzrrJFHLdGnE="
-  - PYPI_USER_NAME: "chaostoolkit"
-  - secure: Mowp8q0AxgQKH/LrW9cOpSyxdZvaD/nhan3Y234sZ5PMZJGZmmoUipjsbzGtKXNWzMiBNIkp8AhDZ0YKrXueMz7T7ZFelMnLbskiIB0rqVDkhVUqwrY/ajtBS+QIDwDVsYk9iXWHVI/mkmbhefM9vpQkeF1892H6Q/lYcbf49UcHLGXZ+5crvZqijWjaGqQArveX0v8KjFFelEHwcog0YmvsS2E1TnDdvGrTL2LxrU2yrjo6Sk+f4Evv37dvfE+I5/UjuRIJ/jMBf4JGTijcwRX/iTqNqwqxnovJ5spYbt1qgTht7KGiiEbu1qy5xHRxKdn4rdq/lK44s0KbeDqfXDL1B2QHL4C13A16/mMn6rrJLEluv3JCpDx55f2Z4CiEWD7LfO71ssgB+A2zHuq05qmRAoqp3lqnLUindJc4KbhLwxOOmg8kI8aJ1SASdxrxp0rWiPbHfytvKP4pyHaxMDB3tfKNFmR/woJl8n8brD+wXnUI2JM4WUfqqtzHJrlk+aQxtAYkq822HyFA246s6352IDqqcqQovh9auZpUMCDfgPy0ngDJdfNESMEIDl5NTYrmtTVWdyKAYumJJzlIlejMffo3CDfIHrQZ9+4Gx7ABctKKNkNKCrgtKio6/uRjp0a4RtTfrqXQrFRlA4TBKVIDfX121ZF0n4yP8fDbZQw=
-
-script: 
-  - bash ci.bash
-notifications:
-  webhooks:
-    urls:
-    - 'https://webhook.atomist.com/atomist/travis/teams/T76U4GPGF'
-    on_cancel: always
-    on_error: always
-    on_start: always
-    on_failure: always
-    on_success: always
-
-after_success:
-  - codecov
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8976625..2286108 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,12 @@
 
 [197]: https://github.com/chaostoolkit/chaostoolkit-lib/issues/197
 
+### Changed
+
+- Moved from TravisCI to GitHub Workflows [#201][201]
+
+[201]: https://github.com/chaostoolkit/chaostoolkit-lib/issues/201
+
 ## [1.16.0][] - 2020-12-02
 
 [1.16.0]: https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.15.1...1.16.0
diff --git a/README.md b/README.md
index 5861fff..a1c7d24 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
 [![Version](https://img.shields.io/pypi/v/chaostoolkit-lib.svg)](https://img.shields.io/pypi/v/chaostoolkit-lib.svg)
 [![License](https://img.shields.io/pypi/l/chaostoolkit-lib.svg)](https://img.shields.io/pypi/l/chaostoolkit-lib.svg)
 
-[![Build Status](https://travis-ci.org/chaostoolkit/chaostoolkit-lib.svg?branch=master)](https://travis-ci.org/chaostoolkit/chaostoolkit-lib)
+![Build](https://github.com/chaostoolkit/chaostoolkit-lib/workflows/Build/badge.svg)
 [![codecov](https://codecov.io/gh/chaostoolkit/chaostoolkit-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/chaostoolkit/chaostoolkit-lib)
 [![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-lib.svg)](https://www.python.org/)
 
diff --git a/ci.bash b/ci.bash
deleted file mode 100644
index e5fccdb..0000000
--- a/ci.bash
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-set -eo pipefail
-
-function lint () {
-    echo "Checking the code syntax"
-    pycodestyle --first chaoslib
-}
-
-function build () {
-    echo "Building the choastoolkit package"
-    python3 setup.py build
-}
-
-function run-test () {
-    echo "Running the tests"
-    python3 setup.py test
-}
-
-function release () {
-    echo "Releasing the package"
-    python3 setup.py release
-
-    echo "Publishing to PyPI"
-    pip3 install twine
-    twine upload dist/* -u ${PYPI_USER_NAME} -p ${PYPI_PWD}
-}
-
-function main () {
-    lint || return 1
-    build || return 1
-    run-test || return 1
-
-    if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
-        if [[ $TRAVIS_PYTHON_VERSION =~ ^3\.5+$ ]]; then
-            if [[ $TRAVIS_TAG =~ ^[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?$ ]]; then
-                echo "Releasing tag $TRAVIS_TAG with Python $TRAVIS_PYTHON_VERSION"
-                release || return 1
-            fi
-        fi
-    fi
-}
-
-main "$@" || exit 1
-exit 0


Test patch:
diff --git a/tests/test_exit.py b/tests/test_exit.py
index 70c6978..49f18cd 100644
--- a/tests/test_exit.py
+++ b/tests/test_exit.py
@@ -1,14 +1,19 @@
 from copy import deepcopy
+import os
 import threading
 import time
 from wsgiref.simple_server import WSGIServer, WSGIRequestHandler
 
+import pytest
+
 from chaoslib.exit import exit_gracefully, exit_ungracefully
 from chaoslib.run import Runner
 from chaoslib.types import Strategy
 
 from fixtures import experiments
 
+pytestmark = pytest.mark.skipif(os.getenv("CI") != None, reason="Skip CI")
+
 
 def run_http_server_in_background():
     def slow_app(environ, start_response):