test.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. name: Node CI
  2. # on: [push]
  3. on:
  4. push:
  5. branches:
  6. - support/github-actions
  7. jobs:
  8. resolve-dependencies:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. matrix:
  12. node-version: [10.x, 12.x]
  13. steps:
  14. - uses: actions/checkout@v1
  15. - name: Use Node.js ${{ matrix.node-version }}
  16. uses: actions/setup-node@v1
  17. with:
  18. node-version: ${{ matrix.node-version }}
  19. - name: install dependencies
  20. run: |
  21. yarn
  22. - name: install plugins
  23. run: |
  24. yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker growi-plugin-attachment-refs
  25. yarn add -D react-images react-motion
  26. - name: print dependencies
  27. run: |
  28. echo -n "node " && node -v
  29. echo -n "npm " && npm -v
  30. yarn list --depth=0
  31. lint:
  32. runs-on: ubuntu-latest
  33. needs: resolve-dependencies
  34. steps:
  35. - uses: actions/checkout@v1
  36. - name: yarn lint
  37. run: |
  38. yarn lint
  39. test:
  40. runs-on: ubuntu-latest
  41. needs: resolve-dependencies
  42. steps:
  43. - name: Launch MongoDB
  44. uses: wbari/start-mongoDB@v0.2
  45. with:
  46. mongoDBVersion: 3.6
  47. - name: yarn test
  48. run: |
  49. yarn test
  50. env:
  51. MONGO_URI: mongodb://localhost:27017/growi_test
  52. build-dev:
  53. runs-on: ubuntu-latest
  54. needs: resolve-dependencies
  55. steps:
  56. - name: yarn build:dev
  57. run: |
  58. yarn build:dev
  59. build-prod:
  60. runs-on: ubuntu-latest
  61. needs: resolve-dependencies
  62. steps:
  63. - name: Launch MongoDB
  64. uses: wbari/start-mongoDB@v0.2
  65. with:
  66. mongoDBVersion: 3.6
  67. - name: yarn build:prod:analyze
  68. run: |
  69. yarn build:prod:analyze
  70. - name: shrink dependencies for production
  71. run: |
  72. yarn install --production
  73. - name: yarn server:prod:ci
  74. run: |
  75. yarn server:prod:ci
  76. env:
  77. MONGO_URI: mongodb://localhost:27017/growi