nodejs-environment.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. name: Node.js CI
  2. on:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ main ]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. matrix:
  12. node-version: [14.x, 16.x, 18.x]
  13. steps:
  14. - uses: actions/checkout@v3
  15. - name: Use Node.js ${{ matrix.node-version }}
  16. uses: actions/setup-node@v3
  17. with:
  18. node-version: ${{ matrix.node-version }}
  19. - run: npm ci
  20. - run: npm run build --if-present
  21. unit-tests:
  22. runs-on: ubuntu-latest
  23. strategy:
  24. matrix:
  25. node-version: [14.x, 16.x, 18.x]
  26. needs: [build]
  27. steps:
  28. - uses: actions/checkout@v3
  29. - name: Use Node.js ${{ matrix.node-version }}
  30. uses: actions/setup-node@v3
  31. with:
  32. node-version: ${{ matrix.node-version }}
  33. - run: npm ci
  34. - run: npm run test
  35. e2e-test:
  36. runs-on: ubuntu-latest
  37. strategy:
  38. matrix:
  39. node-version: [14.x, 16.x, 18.x]
  40. needs: [unit-tests]
  41. steps:
  42. - uses: actions/checkout@v3
  43. - name: Use Node.js ${{ matrix.node-version }}
  44. uses: actions/setup-node@v3
  45. with:
  46. node-version: ${{ matrix.node-version }}
  47. - name: Start Docker-Compose
  48. run: docker-compose up -d db-test
  49. - name: Install npm
  50. uses: actions/setup-node@v3
  51. with:
  52. node-version: ${{ matrix.node-version }}
  53. - run: npm install
  54. - run: cp .env.example-test-e2e .env
  55. - name: Run tests e2e -- register
  56. run: npm run test:e2e -- register.e2e-spec.ts
  57. - name: Run tests e2e -- login
  58. run: npm run test:e2e -- login.e2e-spec.ts
  59. - name: Run tests e2e -- hello
  60. run: npm run test:e2e -- app.e2e-spec.ts
  61. - name: Run tests e2e -- change-password
  62. run: npm run test:e2e -- change-password.e2e-spec.ts
  63. - name: Run tests e2e -- users
  64. run: npm run test:e2e -- users.e2e-spec.ts
  65. - name: Run tests e2e -- forgot-password
  66. run: npm run test:e2e -- forgot-password.e2e-spec.ts
  67. - name: Stop Docker-Compose
  68. run: docker-compose down