# 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
|