From b918362aae11b7468efd913e42f3dd03d856d412 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Thu, 5 Jul 2018 19:16:16 +0300 Subject: [PATCH] Split travis builds into jobs (#4586) * Split travis builds into jobs * Fix gulpfile syntax * Make frontend tests faster by not using gulp * Remove XO spec files ignore --- .travis.yml | 65 +++++++++++++++++++++----------- themes-default/slim/gulpfile.js | 8 ++-- themes-default/slim/package.json | 1 - themes/dark/package.json | 1 - themes/light/package.json | 1 - 5 files changed, 48 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 31f960c248..6ac9560f0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,54 @@ language: python -python: - - 2.7.10 sudo: false -before_install: - - python .github/check_version.py -install: - - pip install --upgrade pip - - pip install --upgrade tox - - pip install dredd_hooks - - pip install 'PyYAML<4' - - pip install six - - nvm install v10.1.0 - - nvm use v10.1.0 - - 'curl -o- -L https://yarnpkg.com/install.sh | bash' - - 'export PATH="$HOME/.yarn/bin:$PATH" && yarn install --ignore-scripts' -script: - - yarn build && yarn test-css - - cd themes-default/slim && yarn test && yarn coverage && cd ../../ - - yarn test-api - - tox -v --recreate cache: yarn: true directories: - $HOME/.cache/pip - node_modules -after_failure: - - cat ./dredd/data/Logs/application.log +before_install: + - python .github/check_version.py +install: false +script: false +jobs: + include: + # test stage + frontend tests start here + - stage: test + env: + - test_type=frontend + language: node_js + node_js: 10.1.0 + install: + - 'curl -o- -L https://yarnpkg.com/install.sh | bash' + - 'export PATH="$HOME/.yarn/bin:$PATH" && yarn install --ignore-scripts' + script: + - yarn test-css + - >- + cd themes-default/slim && + yarn install --ignore-scripts && + yarn xo && + yarn test && + yarn coverage && + cd ../../ + # backend tests start here + - env: + - test_type=backend + python: + - 2.7.10 + install: + - pip install --upgrade pip + - pip install --upgrade tox + # install everything needed for `yarn test-api` + - pip install dredd_hooks + - pip install 'PyYAML<4' + - pip install six + - nvm install v10.1.0 + - 'curl -o- -L https://yarnpkg.com/install.sh | bash' + - 'export PATH="$HOME/.yarn/bin:$PATH" && yarn install --ignore-scripts' + script: + - yarn test-api + - tox -v --recreate + after_failure: + - cat ./dredd/data/Logs/application.log notifications: slack: secure: >- diff --git a/themes-default/slim/gulpfile.js b/themes-default/slim/gulpfile.js index 3fcfb5c8c8..25be3ddb79 100644 --- a/themes-default/slim/gulpfile.js +++ b/themes-default/slim/gulpfile.js @@ -280,7 +280,7 @@ gulp.task('build', done => { // Whe're building the light and dark theme. For this we need to run two sequences. // If we need a yargs parameter name csstheme. setCsstheme(); - runSequence('lint', 'css', 'cssTheme', 'img', 'js', 'static', 'templates', 'root', async() => { + runSequence('lint', 'css', 'cssTheme', 'img', 'js', 'static', 'templates', 'root', () => { if (!PROD) { done(); } @@ -303,11 +303,11 @@ const syncTheme = (theme, sequence) => { * * Do not run the xo build, as this takes a lot of time. */ -gulp.task('sync', async() => { +gulp.task('sync', () => { // Whe're building the light and dark theme. For this we need to run two sequences. // If we need a yargs parameter name csstheme. - for (let theme of Object.entries(config.cssThemes)) { - await syncTheme(theme, ['css', 'cssTheme', 'img', 'js', 'static', 'templates', 'root']); + for (const theme of Object.entries(config.cssThemes)) { + syncTheme(theme, ['css', 'cssTheme', 'img', 'js', 'static', 'templates', 'root']); } }); diff --git a/themes-default/slim/package.json b/themes-default/slim/package.json index 682b95fdce..4d5cf10a83 100644 --- a/themes-default/slim/package.json +++ b/themes-default/slim/package.json @@ -123,7 +123,6 @@ "static/js/lib/**", "static/js/*.min.js", "static/js/vender.js", - "/**/*.spec.js", "build/**" ], "esnext": true diff --git a/themes/dark/package.json b/themes/dark/package.json index 682b95fdce..4d5cf10a83 100644 --- a/themes/dark/package.json +++ b/themes/dark/package.json @@ -123,7 +123,6 @@ "static/js/lib/**", "static/js/*.min.js", "static/js/vender.js", - "/**/*.spec.js", "build/**" ], "esnext": true diff --git a/themes/light/package.json b/themes/light/package.json index 49847f2a24..3d5cf10861 100644 --- a/themes/light/package.json +++ b/themes/light/package.json @@ -123,7 +123,6 @@ "static/js/lib/**", "static/js/*.min.js", "static/js/vender.js", - "/**/*.spec.js", "build/**" ], "esnext": true