sudo: false language: node_js node_js: "10" notifications: email: false git: depth: 3 submodules: false env: global: - MOZ_HEADLESS=1 - SAUCE_USERNAME_PR=valorkinpr - SAUCE_ACCESS_KEY_PR=e0a97bd3-4b74-4408-89bf-cce1b44a8bf1 - BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready - LOGS_DIR=/tmp/logs - CY_KEY=4aa7a1c0-3a4f-444e-b324-6fc305a543a8 stages: - name: Testing if: ( branch = development AND type = push ) OR type = pull_request OR tag =~ ^v\d+ - name: deploy if: branch = development AND type = push OR tag =~ ^v\d+ - name: publish if: tag =~ ^v\d+ - name: "post deploy testing" if: branch = development AND type = push OR tag =~ ^v\d+ before_install: - sh -e /etc/init.d/xvfb start - rm -rf node_modules/ngx-bootstrap install: - npm ci - npm run build - if [[ "$NGV" == "latest" ]]; then ./scripts/ci/npm-ng-latest.sh; fi # - if [[ "$NGV" == "next" ]]; then ./scripts/ci/npm-ng-next.sh; fi - npm i ./dist > /dev/null - if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then export SAUCE_USERNAME=$SAUCE_USERNAME_PR; export SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; fi jobs: fast_finish: true allow_failures: - env: NGV=next - name: sauce-tests include: # precache npm and apt dependencies # - stage: precache # install: npm ci # script: true # addons: # chrome: stable # apt: # sources: # - ubuntu-toolchain-r-test # # required by node-gyp to build some packages # packages: # - g++-4.8 # run in parallel - stage: Testing # lint code script: npm run lint-src name: "Lint" install: true # test - script: npm run test-coverage name: "Test with current Angular version" after_success: ./node_modules/.bin/codecov - script: npm run test name: "Test with latest Angular version" env: NGV=latest # env: NGV=next # test cypress smoke - script: - ng serve --prod & - $(npm bin)/wait-on http-get://$URL - npm run cy:run:smoke # after all tests finish running we need # to kill all background jobs (like "npm start &") - kill $(jobs -p) || true name: "Run cypress smoke testing" env: URL=localhost:4200/# # check prod build - script: npm run demo.ng-build name: "Check prod build with current Angular version" - script: npm run demo.ng-build name: "Check prod build with latest Angular version" env: NGV=latest # env: NGV=next - script: npm run test-cross name: sauce-tests env: SAUCE=true addons: sauce_connect: username: $SAUCE_USERNAME_PR access_key: $SAUCE_ACCESS_KEY_PR before_script: - mkdir -p $LOGS_DIR # deploy to ngx-bootstrap.surge.sh - &surge stage: deploy script: npm run demo.build deploy: provider: surge project: ./gh-pages/ domain: ngx-bootstrap.surge.sh on: development - <<: *surge env: NGV=latest deploy: provider: surge project: ./gh-pages/ domain: ngx-bootstrap-latest.surge.sh on: development # deploy to ngx-universal.herokuapp.com/ - stage: deploy script: npm run build:dynamic before_deploy: - cd ./demo/dist deploy: provider: heroku api_key: $HEROKU_API_KEY skip_cleanup: true app: ngx-universal on: development # publish to gh pages and npm - stage: publish script: npm run demo.build after_deploy: npm run flow.github-release deploy: provider: pages local_dir: gh-pages skip_cleanup: true github_token: $GITHUB_TOKEN app: ngx-universal on: tags: true - stage: publish script: npm run build before_deploy: "cd dist" deploy: provider: npm email: "valorkin@gmail.com" api_key: $NPM_AUTH_TOKEN tag: next skip_cleanup: true on: tags: true # test cypress full for herokuapp - stage: "post deploy testing" name: "Run cypress to check SSR" # env: URL=https://ngx-universal.herokuapp.com/# - script: ./node_modules/.bin/cypress run --config integrationFolder=cypress/integration,baseUrl=https://ngx-universal.herokuapp.com/#/ --record --key $CY_KEY name: "Cypress integration suit run on SSR " - script: ./node_modules/.bin/cypress run --config integrationFolder=cypress/full,baseUrl=https://ngx-universal.herokuapp.com/#/ --record --key $CY_KEY name: "Cypress full suit run on SSR " # test cypress full for gh-pages - script: ./node_modules/.bin/cypress run --config integrationFolder=cypress/integration,baseUrl=http://ngx-bootstrap-latest.surge.sh/#/ --record --key $CY_KEY name: "Cypres integration run with @latest angular" - script: ./node_modules/.bin/cypress run --config integrationFolder=cypress/full,baseUrl=http://ngx-bootstrap-latest.surge.sh/#/ --record --key $CY_KEY name: "Cypres full run with @latest angular" # env: URL=https://valor-software.com/ngx-bootstrap/#/ - script: ./node_modules/.bin/cypress run --config integrationFolder=cypress/integration,baseUrl=https://valor-software.com/ngx-bootstrap/#/ --record --key $CY_KEY name: "Cypress integration on gh-pages after deploy" if: tag =~ ^v\d+ - script: ./node_modules/.bin/cypress run --config integrationFolder=cypress/full,baseUrl=https://valor-software.com/ngx-bootstrap/#/ --record --key $CY_KEY name: "Cypress full on gh-pages after deploy" if: tag =~ ^v\d+ cache: apt: true npm: true directories: - node_modules - ~/.npm - ~/.cache