forked from opencontainers/umoci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
122 lines (111 loc) · 3.63 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# umoci: Umoci Modifies Open Containers' Images
# Copyright (C) 2016-2020 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: ~> 1.0
os: linux
dist: bionic
language: go
go:
- 1.x
services:
- docker
notifications:
email: false
addons:
apt:
packages:
- bc
- gcc-multilib
- zstd
homebrew:
packages:
# Needed for sponge.
# NOTE: This conflicts with gnu_parallel so we'll need to work
# around that when we enable integration testing.
- moreutils
_docker: &docker
|-
# Install a modern version of Docker which supports BuildKit.
./hack/resilient-curl.sh -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
_cache: &cache
cache:
directories:
- .cache
before_script:
- make ci-cache
_matrix_integration: &matrix_integration
<<: *cache
before_install: *docker
script:
- make DOCKER_IMAGE=$DOCKER_IMAGE ci-integration
matrix:
fast_finish: true
include:
# Build and other validation checks.
- name: "validate"
before_install:
# Install basic Go tooling.
- |-
# Need to set GO111MODULE=off here because Travis runs inside our
# source repo (which is a Go module) and thus 'go get' will actually
# add dependencies to our go.mod file. Annoyingly this means we
# cannot require v2 of go-md2man because that requires Go module
# support.
GO111MODULE=off go get -u github.com/cpuguy83/go-md2man
GO111MODULE=off go get -u golang.org/x/lint/golint
GO111MODULE=off go get -u github.com/securego/gosec/cmd/gosec
GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell
script:
# Make sure 32-bit builds work. I'm not sure why GO111MODULE breaks here, but
# disable it since we just care about whether you get compiler errors.
- make GO111MODULE=off GOARCH=386 local-validate-build
- make ci-validate
- |-
make umoci
./umoci help
# Unit tests.
- name: "unit"
<<: *cache
before_install: *docker
script:
# Necessary to make Travis co-operate with Docker.
- chmod a+rwx .
- make ci-unit
- name: "macos-unit"
os: osx
osx_image: xcode12
script:
# TODO: Run the integration tests and rest of the CI, so we don't need
# to special-case MacOS here.
- make local-validate-build
- make local-test-unit
- |-
make umoci
./umoci help
# Integration tests.
- <<: *matrix_integration
name: "integration (fedora)"
env:
- DOCKER_IMAGE="fedora:latest"
- <<: *matrix_integration
name: "integration (opensuse/leap)"
env:
- DOCKER_IMAGE="registry.opensuse.org/opensuse/leap:latest"
- <<: *matrix_integration
name: "integration (debian)"
env:
- DOCKER_IMAGE="debian:latest"