language: node_js
node_js:
  - 9
install:
  - npm install
  - npm install -g codecov
script:
  - npm run lint
  - npm run test.coverage
  - npm run style
  - npm run build
  - npm run ts-node -- ./demo/demo1.ts
  - npm run e2e "My Document.docx"
  - npm run ts-node -- ./demo/demo2.ts
  - npm run ts-node -- ./demo/demo3.ts
  - npm run ts-node -- ./demo/demo4.ts
  - npm run ts-node -- ./demo/demo5.ts
  - npm run ts-node -- ./demo/demo6.ts
  - npm run ts-node -- ./demo/demo7.ts
  - npm run ts-node -- ./demo/demo8.ts
  - npm run ts-node -- ./demo/demo9.ts
  - npm run ts-node -- ./demo/demo10.ts
  - npm run e2e "My Document.docx"
  - npm run ts-node -- ./demo/demo11.ts
  - npm run ts-node -- ./demo/demo12.ts
  - npm run ts-node -- ./demo/demo13.ts
  - npm run ts-node -- ./demo/demo14.ts
  - npm run ts-node -- ./demo/demo15.ts
  - npm run ts-node -- ./demo/demo16.ts
  - npm run ts-node -- ./demo/demo17.ts
  - npm run ts-node -- ./demo/demo18.ts
  - npm run ts-node -- ./demo/demo19.ts
  - npm run ts-node -- ./demo/demo20.ts
  - npm run ts-node -- ./demo/demo21.ts
  - npm run ts-node -- ./demo/demo22.ts
  - npm run ts-node -- ./demo/demo23.ts
  - npm run ts-node -- ./demo/demo24.ts
#   - npm run ts-node -- ./demo/demo25.ts
  - npm run ts-node -- ./demo/demo26.ts
  - npm run ts-node -- ./demo/demo27.ts
  - npm run ts-node -- ./demo/demo28.ts
  - npm run ts-node -- ./demo/demo29.ts
  - npm run ts-node -- ./demo/demo30.ts
  - npm run ts-node -- ./demo/demo31.ts
  - npm run ts-node -- ./demo/demo32.ts
#   - npm run e2e "My Document.docx" // Need to fix
  - npm run ts-node -- ./demo/demo33.ts
  - npm run ts-node -- ./demo/demo34.ts
after_failure:
  - "cat /home/travis/builds/dolanmiu/docx/npm-debug.log"
after_success:
  - npm run typedoc
  - echo "docx.js.org" > docs/.nojekyll
  - echo "docx.js.org" > docs/CNAME
  - codecov
deploy:
  provider: pages
  skip-cleanup: true
  github-token: $GITHUB_TOKEN
  keep-history: true
  local-dir: docs
  on:
    branch: master
