Skip to content

Commit

Permalink
[Travis] [Docs] Allow for running multiple suites in one job 🐪
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Apr 29, 2016
1 parent 065475f commit 49b7eeb
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
26 changes: 13 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ matrix:
include:
-
php: 7.0
env: SYLIUS_SUITE="application"
env: SYLIUS_SUITE=(application)
cache:
directories:
- vendor
Expand All @@ -22,7 +22,7 @@ matrix:
- memcached
-
php: 7.0
env: SYLIUS_SUITE="packages"
env: SYLIUS_SUITE=(docs packages)
cache:
directories:
- ~/.composer/cache/files
Expand All @@ -33,7 +33,7 @@ matrix:
- parallel
-
php: 5.6
env: SYLIUS_SUITE="application"
env: SYLIUS_SUITE=(application)
cache:
directories:
- vendor
Expand All @@ -44,7 +44,7 @@ matrix:
- memcached
-
php: 5.5
env: SYLIUS_SUITE="application"
env: SYLIUS_SUITE=(application)
cache:
directories:
- vendor
Expand All @@ -55,7 +55,7 @@ matrix:
- memcached
-
php: 5.5
env: SYLIUS_SUITE="packages"
env: SYLIUS_SUITE=(packages)
cache:
directories:
- ~/.composer/cache/files
Expand All @@ -66,25 +66,25 @@ matrix:
- parallel

before_install:
- etc/travis/run-suite ${SYLIUS_SUITE} before_install
- etc/travis/run-suite before_install "${SYLIUS_SUITE[@]}"

install:
- etc/travis/run-suite ${SYLIUS_SUITE} install
- etc/travis/run-suite install "${SYLIUS_SUITE[@]}"

before_script:
- etc/travis/run-suite ${SYLIUS_SUITE} before_script
- etc/travis/run-suite before_script "${SYLIUS_SUITE[@]}"

script:
- etc/travis/run-suite ${SYLIUS_SUITE} script
- etc/travis/run-suite script "${SYLIUS_SUITE[@]}"

before_cache:
- etc/travis/run-suite ${SYLIUS_SUITE} before_cache
- etc/travis/run-suite before_cache "${SYLIUS_SUITE[@]}"

after_success:
- etc/travis/run-suite ${SYLIUS_SUITE} after_success
- etc/travis/run-suite after_success "${SYLIUS_SUITE[@]}"

after_failure:
- etc/travis/run-suite ${SYLIUS_SUITE} after_failure
- etc/travis/run-suite after_failure "${SYLIUS_SUITE[@]}"

after_script:
- etc/travis/run-suite ${SYLIUS_SUITE} after_script
- etc/travis/run-suite after_script "${SYLIUS_SUITE[@]}"
13 changes: 8 additions & 5 deletions etc/travis/run-suite
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env bash
set -e

if [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/common/$2.sh" ]; then
/usr/bin/env bash "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/common/$2.sh"
if [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/common/$1.sh" ]; then
/usr/bin/env bash "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/common/$1.sh"
fi

if [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/$1/$2.sh" ]; then
/usr/bin/env bash "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/$1/$2.sh"
fi
IFS=' ' read -r -a suites <<< "$2"
for suite in "${suites[@]}"; do
if [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/${suite}/$1.sh" ]; then
/usr/bin/env bash "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/suites/${suite}/$1.sh"
fi
done
7 changes: 7 additions & 0 deletions etc/travis/suites/docs/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

print_header "Installing" "Sphinx"
run_command "pip install -q --user sphinx"
6 changes: 6 additions & 0 deletions etc/travis/suites/docs/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

print_header "Building" "Documentation"
run_command "sphinx-build -nW -b html docs docs/build"
9 changes: 1 addition & 8 deletions etc/travis/suites/packages/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,4 @@ set -e

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

code=0

print_header "Installing" "Sphinx"
run_command "pip install --user sphinx" || code=$?

etc/bin/install-packages || code=$?

exit ${code}
etc/bin/install-packages
3 changes: 0 additions & 3 deletions etc/travis/suites/packages/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.s

code=0

print_header "Building" "Documentation"
run_command "sphinx-build -nW -b html docs docs/build" || code=$?

etc/bin/validate-packages || code=$?
etc/bin/test-packages || code=$?

Expand Down

0 comments on commit 49b7eeb

Please sign in to comment.