forked from mutagen-io/mutagen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
129 lines (117 loc) · 5.81 KB
/
Copy path.travis.yml
File metadata and controls
129 lines (117 loc) · 5.81 KB
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
123
124
125
126
127
128
129
# Set the language.
language: go
# Set up the build matrix.
matrix:
include:
- os: osx
osx_image: xcode9.4
env:
- MUTAGEN_TEST_END_TO_END=full
- MUTAGEN_TEST_SSH=true
- os: linux
env:
- MUTAGEN_TEST_END_TO_END=full
- MUTAGEN_TEST_SSH=true
- MUTAGEN_TEST_DOCKER=true
- MUTAGEN_TEST_DOCKER_BASE_IMAGE_NAME=alpine
- MUTAGEN_TEST_DOCKER_IMAGE_NAME=mutagentest
- MUTAGEN_TEST_DOCKER_CONTAINER_NAME=mutagentester
- os: windows
env:
- MUTAGEN_TEST_END_TO_END=full
- MUTAGEN_TEST_DOCKER=true
- MUTAGEN_TEST_DOCKER_BASE_IMAGE_NAME=mcr.microsoft.com/windows/servercore:1809
- MUTAGEN_TEST_DOCKER_IMAGE_NAME=mutagentest
- MUTAGEN_TEST_DOCKER_CONTAINER_NAME=mutagentester
- MUTAGEN_TEST_DOCKER_USERNAME=george
# Require use of sudo on POSIX platforms. We need this to set up SSH and/or use
# Docker.
sudo: required
# Require the use of Docker on Linux.
services:
- docker
# Force a newer version of Docker CE on Linux. The default Travis CI version is
# too old for Mutagen to support.
addons:
apt:
packages:
- docker-ce
# Set our Go version(s). Mutagen generally only supports a specific version of
# Go at a time, usually the latest.
# NOTE: When specifying versions with a trailing 0 (e.g. 1.10), you need to
# enclose the version in quotation marks for YAML to treat it as a string rather
# than a float to be truncated:
# https://github.com/travis-ci/travis-ci/issues/9247
go:
- "1.14.2"
# Skip the default install step since it doesn't make sense for Mutagen.
install: true
# Perform setup for testing. We set up SSH for all POSIX platforms, create test
# partitions for macOS and Windows, and set up Docker on Linux on Windows.
before_script:
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then source scripts/ci/setup_ssh.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source scripts/ci/create_test_partitions_darwin.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then scripts/ci/create_test_partitions_windows.bat ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then source scripts/ci/setup_docker.sh ; fi
# Run tests, upload the coverage report, and build bundles.
#
# We have to run a quick build (for the current platform only) before running
# tests because the tests rely on the agent bundle being available. We may need
# to switch this to a testing build (or add some custom build mode for singular
# cross-compilation) if we start invoking Docker from macOS with Linux
# containers. We don't want to do a full build to start with though because that
# can take a while.
#
# We run a few different testing cycles. The first is our primary test cycle for
# behavior and coverage reports. The second test cycle enables race detection,
# but we use a smaller synchronization root for integration tests in this case
# because the tests incur about an order-of-magnitude slowdown due to the race
# detector. The third test cycle (which occurs only on Linux and Windows) is for
# the 386 architecture (where race detection isn't available anyway).
#
# Finally, our build mode depends on what platform we're on. Only macOS is
# capable of building release bundles.
script:
- go version
- go run scripts/build.go --mode=local
- go test -p 1 -v -coverpkg=./pkg/... -coverprofile=coverage.txt ./pkg/...
- MUTAGEN_TEST_END_TO_END=slim go test -p 1 -race ./pkg/...
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then GOARCH=386 go run scripts/build.go --mode=local ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then GOARCH=386 go test -p 1 ./pkg/... ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then go run scripts/build.go --mode=release ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then go run scripts/build.go --mode=slim ; fi
# Upload the coverage report and perform any tear down and Docker infrastructure
# after testing.
# TODO: We may want to add SSH teardown in here.
# HACK: We have to use a non-standard Codecov invocation because Bash on Windows
# doesn't seem to support process substitution, at least not on Travis.
# NOTE: This actually runs after before_deploy, but it's more logical to have it
# at this point in the file. See
# https://docs.travis-ci.com/user/customizing-the-build/ for more information.
after_script:
- curl -s https://codecov.io/bash > codecov
- chmod +x codecov
- ./codecov
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then scripts/ci/teardown_docker.sh ; fi
# HACK: If we're doing a release deployment, convert the Windows bundles to zip
# format. This is a lot simpler than trying to add zip file support to the build
# script. Note that we don't convert the agent bundles - Mutagen knows how to
# read those and users don't need to unzip them (and shouldn't).
before_deploy:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then scripts/ci/convert_windows_release_bundles.sh ; fi
# Upload build artifacts from macOS builders on tagged releases.
deploy:
- provider: releases
api_key:
secure: oGoH8k4iqfXizSDUNaFRMqG+q0hYjJcPQBkCSlDWC/enMtn2HyT4UI+vRCksastjNS6ltGrwlebKVyOzkWQCvN/apiteDHgcwPvaJr4ioEZ/UdNobbD2sRyQ6mntXZoQLmTCouDpj47xQA/8bpWSsKNJscIrWuzBr1IUCnDWGPR27ninXX7eueIB9W2BCiuaXvRcvOmLOQslQ+sZEsUjZ2tJ1IB2gQiQdE0yIeHR3A6WsEKkkQWecCnNvuuhtAJZ0bcvR/aKGm3NPPzmvNHu05whvb55qpWjVBdxExatHNXFal4xvesgmFGzlbxkTOHl6QMauuVPJ0ctAEsWMjeNGYHVtmjR7d9+bpgMhpTtxFz6j/HEVs1hzLcsE96LUkxsK6Mc6xpOVI41rsTMLNYIPqjcfBa4/VNUEBFbX8J68BhJ9Ou3zV1f1N1b4nm6PO3asfVgCbYQNTg0Yx3/27KlNzymccui/LmR3l9jbNdQ/KaH689ZFi6+kTL1U8/i/cPo3rv1goQM0vSbuUe9zoydlfCmn5mnFH85PV2/oW55NrTDoHOD6OMUMAma7c48I4+unVSdg4k3IM+YE0uXHJ/OyPifNUXgp+TMQRb5LerMfjvf7HMyMnPjZZsV4COb55hsdH3dx6Yp8BIUxtRV1yzWlBzRo3DIZ5QqYNydc4Cirok=
skip_cleanup: true
file_glob: true
file: build/release/*
on:
repo: mutagen-io/mutagen
condition: '"$TRAVIS_OS_NAME" == "osx"'
tags: true
# Send notifications.
notifications:
email:
- jacob@mutagen.io