forked from flycheck/flycheck
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
96 lines (85 loc) · 2.66 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Use Python 3.5 for our tooling
language: python
python:
- "3.8"
# Our tests are run with Emacs in Docker
services:
- docker
matrix:
# Don’t wait for jobs that are allowed to fail
fast_finish: true
# Allow master branch to fail
allow_failures:
- env: JOB="emacs" EMACS_VERSION="master"
cache:
- pip
env:
matrix:
# Run our tests on all these Emacs versions
- JOB="emacs" EMACS_VERSION="master"
- JOB="emacs" EMACS_VERSION="27.1"
- JOB="emacs" EMACS_VERSION="26.3"
- JOB="emacs" EMACS_VERSION="25.3"
# A special job to build the manual
- JOB="build-manual"
# And another special job to lint our Python code
- JOB="lint-python"
before_install:
- if [[ $JOB == emacs ]]; then docker pull flycheck/emacs-cask:$EMACS_VERSION; fi
install:
- |
case $JOB in
emacs)
# We use separate Cask files for Emacs 25
if [[ $EMACS_VERSION == 25.* ]]; then
cp Cask.25 Cask
fi
# Install Emacs modes for our tests
docker run --volume "$TRAVIS_BUILD_DIR":/flycheck \
--workdir /flycheck \
flycheck/emacs-cask:$EMACS_VERSION \
/bin/bash -c "make init";;
build-manual)
# Install requirements of documentation
pip install -r doc/requirements.txt;;
lint-python)
# Install requirements for linting
pip install -r maint/requirements.txt;;
esac
script:
- |
# Abort if any command fails
set -e
case $JOB in
emacs)
# Check formatting
docker run --volume "$TRAVIS_BUILD_DIR":/flycheck \
--workdir /flycheck \
flycheck/emacs-cask:$EMACS_VERSION \
/bin/bash -c "make check"
# Compile and run unit tests.
docker run --volume "$TRAVIS_BUILD_DIR":/flycheck \
--workdir /flycheck \
flycheck/emacs-cask:$EMACS_VERSION \
/bin/bash -c "make compile && make unit && make specs"
# If the unit tests succeed, fetch the all-tools container
# and run the integration tests
docker build --build-arg EMACS_VERSION=$EMACS_VERSION \
--tag tools-and-emacs:$EMACS_VERSION \
--file=.travis/tools-and-emacs .
docker run --volume "$TRAVIS_BUILD_DIR":/flycheck \
--workdir /flycheck \
tools-and-emacs:$EMACS_VERSION \
/bin/bash -c "check-tools && make integ" ;;
build-manual)
# Build and deploy the manual
make -C doc SPHINXOPTS=-n html;;
lint-python)
# Lint our Python code
make -C maint check;;
esac
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/efdc5fd9433efa7c6b80
on_success: change