-
Notifications
You must be signed in to change notification settings - Fork 42
/
.travis.yml
48 lines (42 loc) · 2.31 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
# See https://docs.travis-ci.com/user/reference/overview/#for-a-particular-travisyml-configuration
# run `travis lint` prior to check-in!
os: linux # required for arch different than amd64
arch: arm64-graviton2 # we only only test archs not already tested with GH actions
group: edge # required for arm64-graviton2
virt: lxd # faster starting
language: bash
services: docker
cache:
directories: # ~/.func-e/versions is cached so that we only re-download once: for TestFuncEInstall
- $HOME/.func-e/versions
- $HOME/go/pkg/mod
git:
depth: false # TRAVIS_COMMIT_RANGE requires full commit history.
if: (type = push AND branch = master) OR type = pull_request
before_install: | # Prevent test build of a documentation or GitHub Actions only change.
if [ -n "${TRAVIS_COMMIT_RANGE}" ] && ! git diff --name-only "${TRAVIS_COMMIT_RANGE}" -- \
grep -qvE '(\.md)$|^(packaging\/)$|^(site\/)|^(netlify.toml)|^(.github\/)'; then
echo "Stopping job as changes are tested with GitHub Actions"
travis_terminate 0
fi
make check || travis_terminate 1
env: # CENTOS_IMAGE and UBUNTU_IMAGE were built by internal-images.yaml; E2E_FUNC_E_PATH was built via `make dist`
global:
- CENTOS_IMAGE=ghcr.io/tetratelabs/func-e-internal:centos-8
- UBUNTU_IMAGE=ghcr.io/tetratelabs/func-e-internal:ubuntu-20.04
# Read/Write volume mounts for ~/go/pkg/mod and ~/.func-e assist in caching while $PWD shares build outputs
- DOCKER_ARGS="docker run --rm -v $HOME/go/pkg/mod:/home/runner/go/pkg/mod:rw -v $HOME/.func-e/versions:/home/runner/.func-e/versions:rw -v $PWD:/work:rw"
- E2E_FUNC_E_PATH=build/func-e_linux_arm64
script: # Since files below are only written by Docker, there should be no uid/gid conflicts.
# Obviate tests on bad commit (Ubuntu)
- ${DOCKER_ARGS} ${UBUNTU_IMAGE} check
# Build the `func-e` binary (Ubuntu)
- ${DOCKER_ARGS} ${UBUNTU_IMAGE} dist
# Run e2e tests using the `func-e` binary (Ubuntu)
- ${DOCKER_ARGS} ${UBUNTU_IMAGE} -o ${E2E_FUNC_E_PATH}/func-e e2e
# Run e2e tests using the `func-e` binary (CentOS)
- ${DOCKER_ARGS} ${CENTOS_IMAGE} -o ${E2E_FUNC_E_PATH}/func-e e2e
# Test Debian package (Ubuntu)
- ${DOCKER_ARGS} --entrypoint packaging/nfpm/verify_deb.sh ${UBUNTU_IMAGE}
# Test RPM package (CentOS)
- ${DOCKER_ARGS} --entrypoint packaging/nfpm/verify_rpm.sh ${CENTOS_IMAGE}