Skip to content

Commit a3466ba

Browse files
committed
travis: use dep, and build outside of docker
1 parent c58d649 commit a3466ba

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.travis.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,46 @@
1-
language: shell # We do everything inside Docker and don't want travis fiddling with steps or environment variables
2-
1+
dist: trusty
32
sudo: required
4-
53
services:
64
- docker
75

6+
language: go
7+
go:
8+
- "1.5.x"
9+
- "1.10.x"
10+
go_import_path: github.com/coreos/go-systemd
11+
812
env:
913
global:
14+
- IMPORTPATH=github.com/coreos/go-systemd
1015
- GOPATH=/opt
16+
- GO15VENDOREXPERIMENT=1
17+
- DEP_BINDIR=/tmp
1118
- BUILD_DIR=/opt/src/github.com/coreos/go-systemd
1219
matrix:
20+
- DOCKER_BASE=ubuntu:16.04
1321
- DOCKER_BASE=ubuntu:18.04
1422
- DOCKER_BASE=debian:stretch
1523

1624
before_install:
25+
- sudo apt-get -qq update
26+
- sudo apt-get install -y libsystemd-journal-dev libsystemd-daemon-dev
27+
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | INSTALL_DIRECTORY=${DEP_BINDIR} sh
28+
- ${DEP_BINDIR}/dep ensure -v
1729
- docker pull ${DOCKER_BASE}
18-
- docker run --privileged -e GOPATH=${GOPATH} --cidfile=/tmp/cidfile ${DOCKER_BASE} /bin/bash -c "apt-get update && apt-get install -y build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container && go get github.com/coreos/pkg/dlopen && go get github.com/godbus/dbus"
30+
- docker run --privileged -e GOPATH=${GOPATH} --cidfile=/tmp/cidfile ${DOCKER_BASE} /bin/bash -c "apt-get update && apt-get install -y sudo build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container"
1931
- docker commit `cat /tmp/cidfile` go-systemd/container-tests
2032
- rm -f /tmp/cidfile
2133

2234
install:
2335
- docker run -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system
2436

2537
script:
26-
- docker exec `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./test"
38+
- ./scripts/travis/pr-test.sh go_fmt
39+
- ./scripts/travis/pr-test.sh build_source
40+
- ./scripts/travis/pr-test.sh build_tests
41+
- docker exec `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./scripts/travis/pr-test.sh run_tests"
42+
- ./scripts/travis/pr-test.sh go_vet
43+
- ./scripts/travis/pr-test.sh license_check
2744

2845
after_script:
2946
- docker kill `cat /tmp/cidfile`

0 commit comments

Comments
 (0)