Skip to content

Commit

Permalink
ci: refactor to multiple jobs
Browse files Browse the repository at this point in the history
It also adds a temp job that will be kept updated and
is expected to pass for bblfsh#83
and track it's progress.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
  • Loading branch information
bzz committed May 29, 2019
1 parent 8f249f7 commit dd1a115
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 45 deletions.
96 changes: 51 additions & 45 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,63 @@
dist: trusty
sudo: false

language: scala
services:
- docker

jdk:
- openjdk8

scala:
- 2.11.11

services:
- docker

cache:
directories:
- $HOME/.ivy2
- $HOME/.sbt


before_install:
- docker run --privileged -d -p 9432:9432 --name bblfsh bblfsh/bblfshd
- docker exec -it bblfsh bblfshctl driver install --recommended
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends clang g++ gcc gcc-multilib libc6-dev libc6-dev-i386 mingw-w64 patch xz-utils

env:
global:
- OSXCROSS_PATH="$HOME/osxcross"
- OSXCROSS_REV=3034f7149716d815bc473d0a7b35d17e4cf175aa
- SDK_VERSION=10.11
- DARWIN_VERSION=15
- OSX_VERSION_MIN=10.6
- OSXCROSS_SDK_URL="https://s3.dockerproject.org/darwin/v2/MacOSX10.11.sdk.tar.xz"

install:
- mkdir -p /tmp/osxcross
- cd /tmp/osxcross
- curl -sSL "https://codeload.github.com/tpoechtrager/osxcross/tar.gz/${OSXCROSS_REV}" | tar -C /tmp/osxcross --strip=1 -xzf -
- curl -s -S -L -o tarballs/MacOSX${SDK_VERSION}.sdk.tar.xz ${OSXCROSS_SDK_URL}
- UNATTENDED=yes ./build.sh >/dev/null
- mv target "${OSXCROSS_PATH}"
- curl -S -L "https://github.com/karalabe/xgo/blob/647f256c447ee20f9bf13ebc42e612d55994a383/docker/base/patch.tar.xz?raw=true" | xz -dc - | tar -xf -
- mv v1 "${OSXCROSS_PATH}/SDK/MacOSX${SDK_VERSION}.sdk/usr/include/c++/v1"
- rm -rf /tmp/osxcross "${OSXCROSS_PATH}/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man"

script:
- cd $TRAVIS_BUILD_DIR
- ./sbt assembly test
- if [[ -z "$TRAVIS_TAG" ]]; then echo "Skipping this build for non-tag builds."; exit 0; fi
- ./sbt publishLocal
- openssl aes-256-cbc -K $encrypted_97aef7f4ae04_key -iv $encrypted_97aef7f4ae04_iv -in key.asc.enc -out key.asc -d
- gpg --no-default-keyring --primary-keyring ./project/.gnupg/pubring.gpg --secret-keyring ./project/.gnupg/secring.gpg --keyring ./project/.gnupg/pubring.gpg --fingerprint --import key.asc
- ./sbt publishSigned
- ./sbt sonatypeRelease

after_failure:
- docker logs bblfsh
stages:
- name: test
- name: release
if: tag IS present


jobs:
include:
- name: 'All tests'
stage: test
install: &test_setup_anchor
- docker run --privileged -d -p 9432:9432 --name bblfsh bblfsh/bblfshd
- docker exec -it bblfsh bblfshctl driver install --recommended
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends clang g++ gcc gcc-multilib libc6-dev libc6-dev-i386 mingw-w64 patch xz-utils
script:
- ./sbt test
after_failure: &failure_logs_anchor
- docker logs bblfsh

- name: 'V2: passing tests' # TODO(#83): remove, after both tests sets converge
install: *test_setup_anchor
script:
- ./sbt "testOnly *Close* *ClientVersion* *SupportedLanguages*"
- ./sbt "testOnly org.bblfsh.client.v2.BblfshClientParseTest -- -z \"Decoded UAST after parsing\""
- ./sbt "testOnly org.bblfsh.client.v2.BblfshClientParseTest -- -z \"Decoded UAST RootNode\""
after_failure: *failure_logs_anchor

- name: 'Cross-compile, release & publish to Sonatype'
stage: release
before_install:
- mkdir -p /tmp/osxcross
- cd /tmp/osxcross
- curl -sSL "https://codeload.github.com/tpoechtrager/osxcross/tar.gz/${OSXCROSS_REV}" | tar -C /tmp/osxcross --strip=1 -xzf -
- curl -s -S -L -o tarballs/MacOSX${SDK_VERSION}.sdk.tar.xz ${OSXCROSS_SDK_URL}
- UNATTENDED=yes ./build.sh >/dev/null
- mv target "${OSXCROSS_PATH}"
- curl -S -L "https://github.com/karalabe/xgo/blob/647f256c447ee20f9bf13ebc42e612d55994a383/docker/base/patch.tar.xz?raw=true" | xz -dc - | tar -xf -
- mv v1 "${OSXCROSS_PATH}/SDK/MacOSX${SDK_VERSION}.sdk/usr/include/c++/v1"
- rm -rf /tmp/osxcross "${OSXCROSS_PATH}/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man"
script:
- cd $TRAVIS_BUILD_DIR
- ./sbt assembly
- ./sbt publishLocal
- openssl aes-256-cbc -K $encrypted_97aef7f4ae04_key -iv $encrypted_97aef7f4ae04_iv -in key.asc.enc -out key.asc -d
- gpg --no-default-keyring --primary-keyring ./project/.gnupg/pubring.gpg --secret-keyring ./project/.gnupg/secring.gpg --keyring ./project/.gnupg/pubring.gpg --fingerprint --import key.asc
- ./sbt publishSigned
- ./sbt sonatypeRelease

0 comments on commit dd1a115

Please sign in to comment.