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 782377f commit a7cbe13
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 25 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ matrix:
- memcached
-
php: 7.0
env: SYLIUS_SUITE="packages"
env: SYLIUS_SUITE="docs packages"
addons:
apt:
packages:
Expand Down Expand Up @@ -48,25 +48,25 @@ cache:
- $SYLIUS_CACHE_DIR

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}"
17 changes: 12 additions & 5 deletions etc/travis/run-suite
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/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"
fi
code=0

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"
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" || code=$?
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" || code=$?
fi
done

exit ${code}
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 a7cbe13

Please sign in to comment.