@@ -30,92 +30,107 @@ branches:
3030stages :
3131 - name : Greenkeeper
3232 if : branch =~ ^greenkeeper\/
33- - name : Test
3433 - name : Deploy Data
3534 if : branch = master AND type != pull_request
3635 - name : Build + Deploy App
3736
3837
38+ #
39+ # Definitions of dictionaries that are used by the machines below
40+ #
41+
42+ x-definitions :
43+ - &base
44+ before_install :
45+ # print some travis debugging info
46+ - echo "Now testing on $TRAVIS_OS_NAME"
47+ - echo "Travis branch is $TRAVIS_BRANCH"
48+ - echo "Travis is in pull request $TRAVIS_PULL_REQUEST"
49+ - echo "Build triggered by $TRAVIS_EVENT_TYPE"
50+
51+ # force the ruby we want
52+ - echo "Using ruby $TRAVIS_RUBY_VERSION (ruby -v says $(ruby -v))"
53+ - rvm use $TRAVIS_RUBY_VERSION --install --binary --create
54+ - echo "ruby -v is now $(ruby -v)"
55+ - gem install bundler
56+
57+ # force a consistent node version
58+ - echo "Using node $TRAVIS_NODE_VERSION (node -v says $(node -v))"
59+ - nvm install "$TRAVIS_NODE_VERSION"
60+ - nvm use "$TRAVIS_NODE_VERSION"
61+ - echo "node -v is now $(node -v)"
62+
63+ # travis doesn't install yarn automatically on osx
64+ - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew install yarn --without-node; fi
65+
66+ install :
67+ # install packages (if the first fails, try once more)
68+ - yarn || yarn
69+
70+ # install fastlane (if at first you don't succeed, try once more)
71+ - bundle install || bundle install
72+
73+ before_script :
74+ # ensure the env file exists and fill it out
75+ - touch .env.js
76+ - echo "export const GOOGLE_CALENDAR_API_KEY = '$GCAL_KEY'" >> .env.js
77+ - echo "export const GOOGLE_MAPS_API_KEY = '$GMAPS_KEY'" >> .env.js
78+
79+ # disable npm wrapper for npm scripts
80+ - npm config set loglevel=silent
81+ - mkdir -p logs/
82+
83+ after_script :
84+ - npm config set loglevel=notice
85+ - npm run danger -- --id $task
86+
87+ before_cache :
88+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
89+ - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
90+
91+ - &simplejs
92+ os : linux
93+ sudo : false
94+ distro : trusty
95+ language : node_js
96+ node_js : $TRAVIS_NODE_VERSION
97+
98+
3999jobs :
40100 # We define default before_install, install, and before_script steps.
41101 # To skip the default step, use `step_name: skip`.
42102 include :
43103 # Run greenkeeper stuff
44- - stage : Greenkeeper
45- os : linux
46- sudo : false
47- language : node_js
48- node_js : node # install the latest node
49- env : [GREENKEEPER=yes]
50- before_install : skip
104+ - << : *simplejs
105+ stage : Greenkeeper
106+ env : [task=GREENKEEPER]
51107 install : npm install -g greenkeeper-lockfile@1
52- before_script : skip
53108 script : greenkeeper-lockfile-update
54109 after_script : greenkeeper-lockfile-upload
55110
56- # Do node "tests"
57- - stage : Test
58- os : linux
59- sudo : false
60- distro : trusty
61- language : node_js
62- node_js : $TRAVIS_NODE_VERSION
63- env : [JS=yes]
64- before_install :
65- - npm install -g coveralls
66- install :
67- - yarn || yarn
68- before_script :
69- - echo "loglevel=silent" >> .npmrc
70- - mkdir -p logs/
111+ # Deploy the gh-pages data
112+ - << : *simplejs
113+ stage : Deploy Data
114+ env : [task=GH_PAGES]
115+ install : yarn || yarn
71116 script :
72- # Ensure failing status in the pipes
73- - set -o pipefail
74- # Ensure prettiness
75- - npm run prettier
76- - if ! git diff --quiet ./*.js source/; then
77- git diff ./*.js source/ > logs/prettier;
78- fi
79- # Lint
80- - npm run lint | tee logs/eslint
81- # Validate data
82- - npm run validate-data -- --quiet | tee logs/validate-data
83- - npm run validate-bus-data | tee logs/validate-bus-data
117+ - npm run validate-bus-data
118+ - npm run validate-data
84119 - npm run bundle-data
85- # Type check and run tests
86- - npm run flow -- check --quiet | tee logs/flow
87- - npm run test -- --coverage 2>&1 | tee logs/jest
88- after_script :
89- - npm run danger
90- after_success :
91- - coveralls < ./coverage/lcov.info
92-
93- # Deploy the gh-pages data
94- - stage : Deploy Data
95- os : linux
96- sudo : false
97- distro : trusty
98- language : node_js
99- node_js : $TRAVIS_NODE_VERSION
100- env : [GH_PAGES=yes]
101- before_install : skip
102- install :
103- - yarn || yarn
104- before_script : skip
105- script : npm run bundle-data
106120 deploy :
107121 provider : pages
108122 skip_cleanup : true
109123 github_token : $GITHUB_PAGES_TOKEN
110124 local_dir : docs/
111125
112126 # Build/deploy the Android binary
113- - stage : Build + Deploy
127+ - << : *base
128+ stage : Build + Deploy
114129 os : linux
115130 sudo : required
116131 distro : trusty
117132 language : android
118- env : [ANDROID=yes ]
133+ env : [task=ANDROID ]
119134 android :
120135 components :
121136 - tools
@@ -133,69 +148,22 @@ jobs:
133148 - extra-android-m2repository
134149 - extra-google-m2repository
135150 script :
136- - bundle exec fastlane android ci-run
151+ - bundle exec fastlane android ci-run | tee ./logs/build
137152
138153 # Build/deploy the iOS binary
139- - stage : Build + Deploy
154+ - << : *base
155+ stage : Build + Deploy
140156 os : osx
141157 language : objective-c
142- osx_image : xcode9
143- env : [IOS=yes ]
158+ osx_image : xcode9.2
159+ env : [task=IOS ]
144160 script :
145- - bundle exec fastlane ios ci-run
146-
147- #
148- # All of the keys down here are used in each build stage, unless they're overridden.
149- #
150-
151- before_install :
152- # print some travis debugging info
153- - echo "Now testing on $TRAVIS_OS_NAME"
154- - echo "Travis branch is $TRAVIS_BRANCH"
155- - echo "Travis is in pull request $TRAVIS_PULL_REQUEST"
156- - echo "Build triggered by $TRAVIS_EVENT_TYPE"
157-
158- # force the ruby we want
159- - echo "Using ruby $TRAVIS_RUBY_VERSION (ruby -v says $(ruby -v))"
160- - rvm use $TRAVIS_RUBY_VERSION --install --binary --create
161- - echo "ruby -v is now $(ruby -v)"
162- - gem install bundler
163-
164- # force a consistent node version
165- - echo "Using node $TRAVIS_NODE_VERSION (node -v says $(node -v))"
166- - nvm install "$TRAVIS_NODE_VERSION"
167- - nvm use "$TRAVIS_NODE_VERSION"
168- - echo "node -v is now $(node -v)"
169-
170- # travis doesn't install yarn automatically on osx
171- - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew install yarn --without-node; fi
172-
173-
174- install :
175- # install packages (if the first fails, try once more)
176- - yarn || yarn
177-
178- # install fastlane (if at first you don't succeed, try once more)
179- - bundle install || bundle install
180-
181-
182- before_script :
183- # ensure the env file exists and fill it out
184- - touch .env.js
185- - echo "export const GOOGLE_CALENDAR_API_KEY = '$GCAL_KEY'" >> .env.js
186- - echo "export const GOOGLE_MAPS_API_KEY = '$GMAPS_KEY'" >> .env.js
187-
188- # disable npm wrapper for npm scripts
189- - echo "loglevel=silent" >> .npmrc
190-
191-
192- before_cache :
193- - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
194- - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
195- - rm -rf $TMPDIR/jest_preprocess_cache
161+ - bundle exec fastlane ios ci-run | tee ./logs/build
162+ - python2 ./scripts/analyze-gym.py -s 20 < ./logs/build | tee ./logs/analysis || true
196163
197164cache :
198165 bundler : true
166+ yarn : true
199167 directories :
200168 - $HOME/.gradle
201169 - $HOME/.gradle/wrapper/
0 commit comments