2018-02-12 23:59:28 +01:00
# It may be tempting to add parens around each individual clause in this expression, but Travis then builds pushes anyway
if : branch = master OR branch =~ ^release/ OR tag IS present
2017-09-26 02:00:08 +02:00
jobs :
2018-01-12 19:29:14 +01:00
include :
- os : linux
- os : osx
2017-05-24 19:29:30 +02:00
language : go
2017-09-02 21:10:28 +02:00
go : 1.9
2017-06-23 02:56:45 +02:00
sudo : true # give us 7.5GB and >2 bursted cores.
2018-01-12 19:29:14 +01:00
git :
depth : false
2017-05-24 19:29:30 +02:00
before_install :
2017-11-12 01:20:56 +01:00
- export PULUMI_ROOT=/opt/pulumi
# on OSX, /opt/ is not writeable by normal users, so we create /opt/pulumi as root and take ownership of it
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then sudo mkdir /opt/pulumi && sudo chown $USER /opt/pulumi; fi
2017-08-02 03:37:06 +02:00
# Dep for Go dependency management.
- go get -v github.com/golang/dep/cmd/dep
2017-06-21 23:23:48 +02:00
# Gometalinter for good Go linting/hygiene.
- go get -v github.com/alecthomas/gometalinter
- gometalinter --install
2017-06-24 00:11:20 +02:00
# gocovmerge for Go code coverage.
- go get -v github.com/wadey/gocovmerge
2017-09-05 19:26:05 +02:00
# Node.js 6.10.2 for all JavaScript code (to match AWS Lambda).
- nvm install v6.10.2
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
# Install Yarn as per https://yarnpkg.com/lang/en/docs/install-ci/#travis-tab.
2017-10-13 23:43:55 +02:00
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.1
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
- export PATH=$HOME/.yarn/bin:$PATH
2018-02-12 22:13:13 +01:00
# Ensure that we can access Pulumi's private NPM org.
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc
2017-11-29 05:49:26 +01:00
# On OSX, the place pip installs user commands to is not on the $PATH and also pip is called pip2.7
2018-02-12 22:13:13 +01:00
- export PIP=pip
2017-11-29 05:49:26 +01:00
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=$PATH:$HOME/Library/Python/2.7/bin; export PIP=pip2.7; fi
2017-07-21 19:18:55 +02:00
# Install the AWS CLI so that we can publish the resulting release (if applicable) at the end.
2017-11-29 05:49:26 +01:00
- $PIP install --upgrade --user awscli
2018-01-06 08:26:14 +01:00
- export PULUMI_FAILED_TESTS_DIR=$(mktemp -d); echo "${PULUMI_FAILED_TESTS_DIR}"
2017-05-24 20:03:15 +02:00
install :
2017-09-07 20:07:52 +02:00
# Clone the Pulumi-wide repo so we can use its scripts.
2017-09-21 23:09:35 +02:00
- git clone git@github.com:pulumi/home ${GOPATH}/src/github.com/pulumi/home
2017-11-12 01:20:56 +01:00
- make ensure
2017-12-20 03:11:51 +01:00
before_script :
# Ensure the working tree is clean (make ensure may have updated lock files)
- ${GOPATH}/src/github.com/pulumi/home/scripts/check-worktree-is-clean.sh
2018-01-05 07:53:48 +01:00
# Set stdout back to blocking to avoid problems writing large outputs.
# The call to `nvm` above may have changed it.
# https://github.com/pulumi/pulumi-ppc/issues/176
- python -c 'import fcntl, os, sys; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); print("stdout was " + ("nonblocking" if flags & os.O_NONBLOCK else "blocking")); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)'
2017-06-16 18:50:56 +02:00
script :
2017-12-15 21:12:06 +01:00
- make travis_${TRAVIS_EVENT_TYPE} TEST_FAST_TIMEOUT=10m
2018-01-06 08:26:14 +01:00
after_failure :
# Copy any data from failed tests to S3.
2018-02-16 06:51:18 +01:00
- tar czf - -C "${PULUMI_FAILED_TESTS_DIR}" . | aws --region us-west-2 s3 cp - "s3://eng.pulumi.com/travis-logs/${TRAVIS_REPO_SLUG}/${TRAVIS_JOB_NUMBER}/failed-tests.tar.gz" --acl bucket-owner-full-control
- echo "one or more tests failed, to view detailed failure information, visit https://s3.console.aws.amazon.com/s3/buckets/eng.pulumi.com/travis-logs/${TRAVIS_REPO_SLUG}/${TRAVIS_JOB_NUMBER}/"
2017-05-25 16:36:17 +02:00
notifications :
2017-11-15 20:42:26 +01:00
webhooks : https://ufci1w66n3.execute-api.us-west-2.amazonaws.com/stage/travis