Skip to content

Commit 17f9412

Browse files
committed
Split CI build into two jobs
This makes it easier to see the cause of a build failure at a glance.
1 parent a1fa0b1 commit 17f9412

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

.travis.yml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
# This file is used to configure the Travis CI tests for this repository
22

3-
sudo: false
4-
5-
6-
# It's necessary to do this just for codespell
7-
language: python
8-
python: 3.6
9-
10-
11-
script:
12-
# Formatting checks:
13-
# Check for files starting with a blank line
14-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
15-
# Check for tabs
16-
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi"
17-
# Check for trailing whitespace
18-
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi"
19-
# Check for non-Unix line endings
20-
- "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi"
21-
# Check for blank lines at end of files
22-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
23-
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
24-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'if test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
25-
26-
# Check for typos
27-
- pip install codespell
28-
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" "${TRAVIS_BUILD_DIR}"
3+
env:
4+
matrix:
5+
include:
6+
- name: "Formatting checks"
7+
language: minimal
8+
script:
9+
# Formatting checks:
10+
# Check for files starting with a blank line
11+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
12+
# Check for tabs
13+
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi"
14+
# Check for trailing whitespace
15+
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi"
16+
# Check for non-Unix line endings
17+
- "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi"
18+
# Check for blank lines at end of files
19+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
20+
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
21+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'if test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
22+
23+
- name: "Spell check"
24+
language: python
25+
python: 3.6
26+
install:
27+
# https://github.com/codespell-project/codespell
28+
- pip install codespell
29+
script:
30+
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" "${TRAVIS_BUILD_DIR}"
2931

3032

3133
notifications:

0 commit comments

Comments
 (0)