infra: Refactor travis.

* Use build stages to be clearer.
 * Run Python / C++ tests / Format separately.
 * Reduce duplication

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
Tim 'mithro' Ansell 2019-01-10 20:04:44 -08:00
parent 0def5b2eeb
commit 463000bafd
1 changed files with 29 additions and 39 deletions

View File

@ -1,43 +1,33 @@
matrix:
os: linux
dist: trusty
language: python
python: 3.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- clang-format-5.0
- g++-6
install:
- export CC=gcc-6
- export CXX=g++-6
- make env
jobs:
include:
# Job 1) Runs the tests
- os: linux
dist: trusty
language: python
python: 3.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
install:
- export CC=gcc-6
- export CXX=g++-6
- make env
# State 1 - Tests
- stage: "Tests"
name: "C++ Tests"
script: make test-cpp
- name: "Python Tests"
script: make test-py
- name: "Format"
script:
- export CC=gcc-6
- export CXX=g++-6
- make test
# Job 2) Checks the formatting
- os: linux
dist: trusty
language: python
python: 3.6
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
- ubuntu-toolchain-r-test
packages:
- clang-format-5.0
- g++-6
install:
- export CC=gcc-6
- export CXX=g++-6
- make env
script:
- export CC=gcc-6
- export CXX=g++-6
- make format
- test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }