Skip to content

Commit e68d69c

Browse files
committed
Grunt static added to Traivs CI tests
1 parent 90790da commit e68d69c

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,4 @@ matrix:
3939
before_install: ./dev/travis/before_install.sh
4040
install: composer install --no-interaction --prefer-dist
4141
before_script: ./dev/travis/before_script.sh
42-
script:
43-
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
44-
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
45-
- if [ $TEST_SUITE == "js" ]; then grunt spec; fi
42+
script: ./dev/travis/script.sh

dev/travis/before_install.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ phpenv rehash;
1919

2020
# If env var is present, configure support for 3rd party builds which include private dependencies
2121
test -n "$GITHUB_TOKEN" && composer config github-oauth.github.com "$GITHUB_TOKEN" || true
22+
23+
# Node.js setup via NVM
24+
if [ $TEST_SUITE = "static" ] || [ test $TEST_SUITE == "js" ]; then
25+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
26+
export NVM_DIR="$HOME/.nvm"
27+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
28+
29+
nvm install $NODE_JS_VERSION
30+
nvm use $NODE_JS_VERSION
31+
node --version
32+
33+
npm install -g yarn
34+
yarn global add grunt-cli
35+
fi

dev/travis/before_script.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,14 @@ case $TEST_SUITE in
7575
cat "$changed_files_ce" | sed 's/^/ + including /'
7676

7777
cd ../../..
78+
79+
cp package.json.sample package.json
80+
cp Gruntfile.js.sample Gruntfile.js
81+
yarn
7882
;;
7983
js)
80-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
81-
export NVM_DIR="$HOME/.nvm"
82-
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
83-
nvm install $NODE_JS_VERSION
84-
nvm use $NODE_JS_VERSION
85-
node --version
86-
8784
cp package.json.sample package.json
8885
cp Gruntfile.js.sample Gruntfile.js
89-
npm install -g yarn
90-
yarn global add grunt-cli
9186
yarn
9287

9388
echo "Installing Magento"

dev/travis/script.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
case $TEST_SUITE in
2+
static)
3+
TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
4+
phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER
5+
grunt static
6+
;;
7+
js)
8+
grunt spec;
9+
;;
10+
esac

0 commit comments

Comments
 (0)