test.yml 1.8 KB

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