Skip to content

Commit

Permalink
Merge pull request #129 from rejeep/travis-os-matrix
Browse files Browse the repository at this point in the history
Add Xenial support
  • Loading branch information
sambrightman authored Sep 23, 2019
2 parents e63a186 + a824dd3 commit 96c10c8
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 43 deletions.
105 changes: 75 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,79 @@
os: linux
dist: trusty
language: ruby
matrix:
include:
- os: linux
dist: trusty
env: EVM_EMACS=emacs-24.1-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-24.2-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-24.3-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-24.4-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-24.5-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-25.1-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-25.2-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-25.3-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-26.1-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-26.2-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-26.3-travis
- os: linux
dist: trusty
env: EVM_EMACS=emacs-git-snapshot-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-24.1-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-24.2-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-24.3-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-24.4-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-24.5-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-25.1-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-25.2-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-25.3-travis
- os: linux
dist: xenial
env: EVM_EMACS=emacs-26.1-travis-linux-xenial
- os: linux
dist: xenial
env: EVM_EMACS=emacs-26.2-travis-linux-xenial
- os: linux
dist: xenial
env: EVM_EMACS=emacs-26.3-travis-linux-xenial
before_install:
- sudo mkdir /usr/local/evm
- sudo chown travis:travis /usr/local/evm

- sudo add-apt-repository -y ppa:cassou/emacs
- sudo apt-get update -qq
- sudo apt-get build-dep -qq emacs23
- sudo apt-get build-dep -qq emacs24

- bin/evm config path /tmp
- bin/evm install $EVM_EMACS
- bin/evm use $EVM_EMACS
Expand All @@ -18,29 +82,10 @@ script:
- bundle exec rspec spec
- bin/emacs --version
- bin/emacs -Q --batch --eval
'(unless (or (string= (getenv "EVM_EMACS")
(format "emacs-%d.%d-travis"
emacs-major-version
emacs-minor-version))
'(unless (or (string-prefix-p (format "emacs-%d.%d-travis"
emacs-major-version
emacs-minor-version)
(getenv "EVM_EMACS"))
(and (string= (getenv "EVM_EMACS") "emacs-git-snapshot-travis")
(= emacs-major-version 27)))
(kill-emacs 1))'
rvm:
- 2.3.8
- 2.4.6
- 2.5.5
- 2.6.3
- ruby-head
env:
- EVM_EMACS=emacs-24.1-travis
- EVM_EMACS=emacs-24.2-travis
- EVM_EMACS=emacs-24.3-travis
- EVM_EMACS=emacs-24.4-travis
- EVM_EMACS=emacs-24.5-travis
- EVM_EMACS=emacs-25.1-travis
- EVM_EMACS=emacs-25.2-travis
- EVM_EMACS=emacs-25.3-travis
- EVM_EMACS=emacs-26.1-travis
- EVM_EMACS=emacs-26.2-travis
- EVM_EMACS=emacs-26.3-travis
- EVM_EMACS=emacs-git-snapshot-travis
4 changes: 2 additions & 2 deletions docker/build-emacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function build_emacs() {
--without-x \
--without-all \
--with-gnutls \
--prefix="/tmp/emacs-${VERSION}-travis" && \
--prefix="/tmp/${RELEASE}" && \
make bootstrap && \
make install && \
tar -C /tmp -czf "/tmp/emacs-${VERSION}-travis.tar.gz" "emacs-${VERSION}-travis"
tar -C /tmp -czf "/tmp/${RELEASE}.tar.gz" "${RELEASE}"
}

build_emacs
25 changes: 15 additions & 10 deletions docker/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ set -o errexit
set -o nounset

function usage() {
echo "$(basename "$0") [OPTIONS] VERSION"
echo "$(basename "$0") [OPTIONS] VERSION DIST"
echo
echo "Build Emacs for execution in Travis CI."
echo
echo " VERSION Emacs version to build"
echo " VERSION Emacs version to build (e.g. 26.3)"
echo " DIST Distribution to build from (e.g. linux-xenial)"
echo
echo "Options:"
echo " -h Show help"
Expand All @@ -32,28 +33,32 @@ function parse_args() {
done
shift $((OPTIND - 1))

VERSION=${1:-} && shift
if [ -z "${VERSION}" ]; then
echo "VERSION is required!"
VERSION=${1:-} && shift || true
DIST=${1:-} && shift || true
if [ -z "${VERSION}" ] || [ -z "${DIST}" ]; then
echo "VERSION and DIST are required!"
usage
exit 2
fi
}

# see http://stackoverflow.com/questions/37544423/how-to-build-emacs-from-source-in-docker-hub-gap-between-bss-and-heap#37561793
function build_release() {
cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")" || exit 3
local script_dir
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit 3

local image="evm-travis-builder:latest"
local container="build-emacs-${VERSION}-travis"
local image="evm-travis-${DIST}-builder:latest"
local release="emacs-${VERSION}-travis-${DIST}"
local container="build-${release}"

docker build -t ${image} .
docker build -t ${image} -f "${script_dir}/${DIST}.Dockerfile" "${script_dir}"
docker run \
--name "${container}" \
--env VERSION="${VERSION}" \
--env RELEASE="${release}" \
--security-opt seccomp=unconfined \
${image}
docker cp "${container}:/tmp/emacs-${VERSION}-travis.tar.gz" .
docker cp "${container}:/tmp/${release}.tar.gz" .
${KEEP_CONTAINER} || docker rm "${container}"
}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile → docker/linux-trusty.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ RUN apt-get update -y \

USER travis
WORKDIR /home/travis
COPY docker/build-emacs.sh /home/travis/
COPY build-emacs.sh /home/travis/
CMD ["./build-emacs.sh"]
21 changes: 21 additions & 0 deletions docker/linux-xenial.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM travisci/ci-sardonyx:packer-1564753982-0c06deb6

# hadolint ignore=DL3008
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
autoconf \
autogen \
automake \
build-essential \
git \
libgnutls-dev \
libncurses-dev \
libtool \
texinfo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

USER travis
WORKDIR /home/travis
COPY build-emacs.sh /home/travis/
CMD ["./build-emacs.sh"]
7 changes: 7 additions & 0 deletions recipes/emacs-26.1-travis-linux-xenial.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
recipe 'emacs-26.1-travis-linux-xenial' do
tar_gz 'https://github.com/rejeep/evm/releases/download/v0.18.0/emacs-26.1-travis.tar.gz'

install do
copy build_path, installations_path
end
end
7 changes: 7 additions & 0 deletions recipes/emacs-26.2-travis-linux-xenial.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
recipe 'emacs-26.2-travis-linux-xenial' do
tar_gz 'https://github.com/rejeep/evm/releases/download/v0.18.0/emacs-26.2-travis.tar.gz'

install do
copy build_path, installations_path
end
end
7 changes: 7 additions & 0 deletions recipes/emacs-26.3-travis-linux-xenial.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
recipe 'emacs-26.3-travis-linux-xenial' do
tar_gz 'https://github.com/rejeep/evm/releases/download/v0.18.0/emacs-26.3-travis.tar.gz'

install do
copy build_path, installations_path
end
end

0 comments on commit 96c10c8

Please sign in to comment.