diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..430557f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: c +services: + - docker + +env: + matrix: + - ITEST_TARGET=itest_trusty + - ITEST_TARGET=itest_xenial + - ITEST_TARGET=itest_bionic + - ITEST_TARGET=itest_jessie + - ITEST_TARGET=itest_stretch + - ITEST_TARGET=itest_tox + +script: + - make "$ITEST_TARGET" diff --git a/Makefile b/Makefile index 56cf59c..6de03c6 100644 --- a/Makefile +++ b/Makefile @@ -69,18 +69,19 @@ test: install-hooks: tox -e pre-commit -- install -f --install-hooks -ITEST_TARGETS = itest_trusty itest_xenial itest_jessie itest_stretch +ITEST_TARGETS = itest_trusty itest_xenial itest_bionic itest_jessie itest_stretch .PHONY: itest $(ITEST_TARGETS) itest: $(ITEST_TARGETS) itest_trusty: _itest-ubuntu-trusty itest_xenial: _itest-ubuntu-xenial +itest_bionic: _itest-ubuntu-bionic itest_jessie: _itest-debian-jessie itest_stretch: _itest-debian-stretch itest_tox: - $(DOCKER_RUN_TEST) ubuntu:xenial /mnt/ci/docker-tox-test + $(DOCKER_RUN_TEST) ubuntu:bionic /mnt/ci/docker-tox-test _itest-%: _itest_deb-% _itest_python-% @true diff --git a/README.md b/README.md index 414a480..0bdae5e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ dumb-init ======== -[![Circle CI](https://circleci.com/gh/Yelp/dumb-init.svg?style=svg)](https://circleci.com/gh/Yelp/dumb-init) +[![Travis CI](https://travis-ci.org/Yelp/dumb-init.svg?branch=travis-ci)](https://travis-ci.org/Yelp/dumb-init/) [![PyPI version](https://badge.fury.io/py/dumb-init.svg)](https://pypi.python.org/pypi/dumb-init) diff --git a/ci/circle b/ci/circle deleted file mode 100755 index 552ea1a..0000000 --- a/ci/circle +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python2.7 -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import os -import sys -from subprocess import call - -BOLD = '\033[1m' -RED = '\033[91m' -GREEN = '\033[92m' -YELLOW = '\033[33m' -RESET = '\033[0m' - -TARGETS = [ - 'itest_trusty', - 'itest_xenial', - 'itest_jessie', - 'itest_stretch', - 'itest_tox', -] - - -def log(line, color=''): - print(BOLD + color + line + RESET) - - -if __name__ == '__main__': - num_workers = int(os.environ['CIRCLE_NODE_TOTAL']) - node_index = int(os.environ['CIRCLE_NODE_INDEX']) - assert node_index < num_workers - - my_targets = TARGETS[node_index::num_workers] - status = 0 - - for target in my_targets: - log('Executing target {}...'.format(target), color=YELLOW) - target_status = call(('make', target)) - - if target_status == 0: - log( - 'Target {} completed successfully'.format(target), - color=GREEN, - ) - else: - status = target_status - log( - 'Error! Target {} failed with exit status {}'.format( - target, - target_status, - ), - color=RED, - ) - - sys.exit(status) diff --git a/ci/docker-tox b/ci/docker-tox deleted file mode 100644 index 652e56f..0000000 --- a/ci/docker-tox +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -eux -set -o pipefail - -. /mnt/ci/docker - -# The default mirrors are too flaky to run reliably in CI. -sed -E \ - '/security\.debian/! s@http://[^/]+/@http://mirrors.kernel.org/@' \ - -i /etc/apt/sources.list - -apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x5BB92C09DB82666C -echo 'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main' >> /etc/apt/sources.list - -apt-get update -apt-get install -y --no-install-recommends \ - git \ - python2.7-dev \ - python3.6-dev - -# We cannot use the Ubuntu versions of tox or virtualenv: -# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754248 -pip install tox virtualenv -hash -r - -tox diff --git a/ci/docker-tox-test b/ci/docker-tox-test index 17b44f7..471c861 100755 --- a/ci/docker-tox-test +++ b/ci/docker-tox-test @@ -2,3 +2,12 @@ set -o pipefail . /mnt/ci/docker + +apt-get update +apt-get install -y --no-install-recommends \ + git \ + python2.7-dev \ + python3.6-dev \ + tox + +tox