Skip to content

Commit

Permalink
Another approach for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Jul 16, 2017
1 parent 3b349d1 commit a0f386e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
36 changes: 23 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
language: java
os: linux
jdk: oraclejdk8

env:
- SBT_TEST_CMD="validate"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validate"
- SBT_TEST_CMD="validateUniversal"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateUniversal"
- SBT_TEST_CMD="validateJar"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJar"
- SBT_TEST_CMD="validateBash"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateBash"
- SBT_TEST_CMD="validateAsh"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateAsh"
- SBT_TEST_CMD="validateRpm"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateRpm"
- SBT_TEST_CMD="validateDebian"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDebian"
- SBT_TEST_CMD="validateDocker"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDocker"
- SBT_TEST_CMD="validateJdkPackager"
- SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackager"

before_install:
- if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then
brew update;
brew install xz;
fi
script:
- if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then
./sbt "$SBT_VERSION_CMD validateOSX" ;
fi
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
./sbt "$SBT_VERSION_CMD validateLinux" ;
fi
script: ./sbt "$SBT_TEST_CMD" ;

matrix:
include:
- os: linux
env: SBT_VERSION_CMD="++2.10.6"
jdk: oraclejdk8
- os: linux
env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6"
jdk: oraclejdk8
# oraclejdk8 is not yet available.
# see https://github.com/travis-ci/travis-ci/issues/2316
- os: osx
Expand Down
29 changes: 17 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,20 @@ bintrayRepository := "sbt-plugin-releases"
scalafmtConfig := Some(file(".scalafmt.conf"))

// ci commands
addCommandAlias(
"validate",
"; update ; test ; set scriptedBufferLog := false ; scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings"
)
addCommandAlias("validateUnix", "scripted universal/* jar/* bash/* ash/*")

addCommandAlias("validateOSX", "; validate ; validateUnix")
addCommandAlias(
"validateLinux",
"; validate ; validateUnix ; scripted rpm/* debian/* docker/staging docker/entrypoint docker/ports docker/volumes"
)
addCommandAlias("validateWindows", ";test-only * -- -n windows;scripted universal/dist universal/stage windows/*")
addCommandAlias("validate", "; clean ; update ; test")

// List all scripted test separately to schedule them in different travis-ci jobs.
// Travis-CI has hard timeouts for jobs, so we run them in smaller jobs as the scripted
// tests take quite some time to run.
// Ultimatley we should run only those tests that are necessary for a change
addCommandAlias("validateUniversal", "scripted universal/*")
addCommandAlias("validateJar", "scripted jar/*")
addCommandAlias("validateBash", "scripted bash/*")
addCommandAlias("validateAsh", "scripted ash/*")
addCommandAlias("validateRpm", "scripted rpm/*")
addCommandAlias("validateDebian", "scripted debian/*")
addCommandAlias("validateDocker", "scripted docker/*")
addCommandAlias("validateJdkPackager", "scripted docker/*")

// TODO check the cygwin scripted tests and run them on appveyor
addCommandAlias("validateWindows", "; test-only * -- -n windows;scripted universal/dist universal/stage windows/*")

0 comments on commit a0f386e

Please sign in to comment.