helix/.travis.yml

97 lines
3.0 KiB
YAML

os:
- linux
- osx
dist: trusty # For linux
addons:
apt:
packages:
- g++-mingw-w64 # For dlltool
language: ruby
rvm:
- 2.4.0
cache:
directories:
- $HOME/.rvm/gems
- $HOME/.cargo
- $HOME/.multirust
env:
global:
- EXAMPLES="unit calculator console duration docopt game_of_life geometry json_builder membership text_transform turbo_blank"
- VERBOSE=true
- RUST_BACKTRACE=1
- RUST_VERSION=stable
matrix:
include:
- os: linux
env: RUST_VERSION=nightly
allow_failures:
- env: RUST_VERSION=nightly
before_install:
# If we've got a tag, we also want to test the release
- if [ ! -z "$TRAVIS_TAG" ]; then export TEST_RELEASE=1; fi
# This only works on Linux
- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then unset TEST_RELEASE; fi
# Only try to release on stable
# FIXME: There should be a better way of doing this
- if [[ "$RUST_VERSION" != "stable" ]]; then unset TEST_RELEASE; fi
# Install Rust
- if [ ! -e "$HOME/.cargo/bin" ]; then curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION -y; fi
- export PATH="$HOME/.cargo/bin:$PATH"
- rustup default $RUST_VERSION
- gem install bundler
install:
- ./scripts/ci-install
script: |
if [ -z "$TEST_RELEASE" ]; then
# Run regular tests if we're not testing the release
rake
else
set -e
./scripts/test-release
# Release if we're also tagged
if [ ! -z "$TRAVIS_TAG" ]; then
# Set up Cargo and Rubygems credentials
cargo login $CARGO_TOKEN
mkdir -p ~/.gem
echo -e "---\n:rubygems_api_key: $RUBYGEMS_TOKEN" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
echo -e "Publishing helix_runtime gem...\n"
pushd ruby
gem build helix_runtime.gemspec
gem push helix_runtime-*.gem
popd
echo -e "Publishing libcruby-sys crate...\n"
# need to do this since there's a .gitignore with *.lib files
# there's a bug in Cargo, where include isn't overriding exclude
rm -rf .git
pushd crates/libcruby-sys
HELIX_LIB_DIR=$PWD cargo publish
popd
echo -e "Publishing helix crate...\n"
cargo publish
fi
fi
notifications:
slack:
rooms:
- secure: "EeBBy+QWPtj20Dh0dw9MrIiul6kmVb7YrAqaf8VzpujD8BctasqoPx8VEefHZbBYnzDo8+/yerNorwczU7w5SmSXPvYgTCpUe3eKMgbLNBDBkLhp7L5WMO6YWdlsBpOT+i7lpImqecxTasMcTeMTMPoljtkaZdF+6+kh0dPntGMXsJlh8WWipFHH08anbTz4Ll8R9kta54r9yT2YDp0LSBKC+C2mW6ll6yvRwHZMbLi3c+DzR1mqCIljmeNTIqVm0+Er34Jj8lKOL8dYhyB8TncmxlDdbpzA9R8rJ8GczwvUJOkY3IREvY0eZh1T8JZ4yZZucIq1VgukgMo8rWjMBxq5jJjHpO/EmcyGPvvNnrkg5/Jy/2zDPpdqLvAieD5DReGUEkXcyPjNC2o0K6HAMQnloO2qVRwWIsuvwPu/EK9CFtSebZYSA1cDbQsvAyQ8c4S8nxYOy5YiZwJoD55N051p6ehTGe0gPDn254GwDMEmPEpH4xP/TmYEMzMFqjeSpOKPHNKRqrTmM7dff5yQnRdcm8o2t5GABf29uRkbao0fJa5kVQkVchbzo7U0mfguMGCSMJWM9yMp+mJ8dlz5WitsbGx0Bimu2ZnjOQ5YdQaJWQnCX1Rf+DwqGEipI3ii+l9xeg1VKfZi9Geckn9cF8yaw/y5A/EuvQOKmeOQ7qQ="
on_pull_requests: false
on_success: change
on_failure: always