Просмотр исходного кода

Only run journey-tests if config.json or exercises dir has been modified

Logan Stucki 9 лет назад
Родитель
Сommit
94a7e5d9af
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 13 добавлений и 5 удалений
  1. 13
    5
      .travis.yml

+ 13
- 5
.travis.yml Просмотреть файл

4
   - oraclejdk8
4
   - oraclejdk8
5
 env:
5
 env:
6
   - SCRIPT=bin/unit-tests.sh
6
   - SCRIPT=bin/unit-tests.sh
7
-  - SCRIPT=bin/journey-test.sh
7
+ 
8
+  # https://stackoverflow.com/questions/3790454/in-yaml-how-do-i-break-a-string-over-multiple-lines
9
+  - SCRIPT="bin/build-jq.sh;
10
+      for file in \`curl -s https://api.github.com/repos/exercism/java/pulls/$TRAVIS_PULL_REQUEST/files | bin/jq -r '.[].filename'\`;
11
+      do if [[ \$file == exercises* ]] || [[ \$file == config.json ]];
12
+        then bin/journey-tests.sh;
13
+        break;
14
+      fi;
15
+    done"
8
 
16
 
9
 # http://docs.travis-ci.com/user/migrating-from-legacy
17
 # http://docs.travis-ci.com/user/migrating-from-legacy
10
 sudo: false
18
 sudo: false
14
     packages:
22
     packages:
15
       - tree
23
       - tree
16
 
24
 
17
-before_install:
18
-  - rvm install 2.2.5
19
-  - rvm use 2.2.5
25
+before_install:		
26
+  - rvm install 2.2.5		
27
+  - rvm use 2.2.5		
20
   - bin/build-jq.sh  # we want jq 1.5 features; not avail through pkg repo.
28
   - bin/build-jq.sh  # we want jq 1.5 features; not avail through pkg repo.
21
 
29
 
22
 # https://docs.travis-ci.com/user/customizing-the-build#Skipping-the-Installation-Step
30
 # https://docs.travis-ci.com/user/customizing-the-build#Skipping-the-Installation-Step
26
   - export PATH=$TRAVIS_BUILD_DIR/bin:$PATH  # ensure our tools are prefered over included ones.
34
   - export PATH=$TRAVIS_BUILD_DIR/bin:$PATH  # ensure our tools are prefered over included ones.
27
 
35
 
28
 script:
36
 script:
29
-  - $SCRIPT
37
+  - eval $SCRIPT
30
 
38
 
31
 # configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
39
 # configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
32
 before_cache:
40
 before_cache: