-
Notifications
You must be signed in to change notification settings - Fork 43
/
.travis.yml
59 lines (49 loc) · 2.98 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
sudo: required
env:
- DOCKER_USER=travis
services:
- docker
# This is just here for Travis CI to report correctly
language: go
go:
- "1.12" # quote this
# Not need as we are not running GO in this image, but the Docker image
# go_import_path: github.com/clearlinux/clr-installer
before_install:
- docker pull clearlinux/clr-installer-ci
- docker run --network=host --name clear-test -v $(pwd):/travis -v /dev:/dev -v /var/tmp/test:/tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e container=docker --privileged --tmpfs /run --tmpfs /run/lock -dit --rm clearlinux/clr-installer-ci:latest /sbin/init
- docker ps
- docker exec -it clear-test bash -c "swupd clean" # TODO: Remove this when swupd is fixed; needed as of swupd 3.20.0
# Do NOT use -l (login) for the bash shell or the default profile
# (/usr/share/defaults/etc/profile) will reset PATH removing the
# GOPATH/bin added to the clr-installer-ci Docker image.
# Just use the latest Docker image build for now
#install:
# - docker exec -it clear-test bash -c "swupd update"
before_script:
# create a non-root user mapping the travis user (using same uid)
- docker exec -it clear-test bash -c "useradd -u $(id --u) $DOCKER_USER"
# Show the current swupd configuration
- docker exec -it clear-test bash -c "swupd info"
# Debug information
- docker exec -it clear-test bash -c "set;printenv"
# Debug information to verify restart
- docker exec -it clear-test bash -c "journalctl|cat"
script:
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make dist-clean"
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make"
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) PATH=${PATH}:${GOPATH}:/go/bin make vendor-check"
- travis_retry docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make install-linters-force"
- travis_wait 30 sleep infinity & docker exec -it clear-test bash -c "cd /travis ; make lint"
- travis_retry docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make check"
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make check-clean"
- travis_retry docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make check-image"
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make clean"
- docker exec -it clear-test bash -c "chown -R travis:travis /travis"
- docker exec --user "${DOCKER_USER}" -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make"
- travis_retry docker exec --user "${DOCKER_USER}" -it clear-test bash -c "cd /travis ; ./tests/check-coverage.sh"
- docker exec -it clear-test bash -c "mkdir -p /opt/test-dest"
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make install DESTDIR=/opt/test-dest"
after_script:
- docker exec -it clear-test bash -c "cd /travis ; MAKEFLAGS=-j$(nproc) make clean"
- docker container stop clear-test