You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cypress.yml 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: Cypress
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - master
  7. - stable*
  8. env:
  9. APP_NAME: viewer
  10. BRANCH: ${{ github.base_ref }}
  11. TESTING: true
  12. jobs:
  13. init:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout server
  17. uses: actions/checkout@v3
  18. - name: Read package.json node and npm engines version
  19. uses: skjnldsv/read-package-engines-version-actions@v1.2
  20. id: versions
  21. with:
  22. fallbackNode: "^12"
  23. fallbackNpm: "^6"
  24. - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
  25. uses: actions/setup-node@v3
  26. with:
  27. cache: 'npm'
  28. node-version: ${{ steps.versions.outputs.nodeVersion }}
  29. - name: Set up npm ${{ steps.versions.outputs.npmVersion }}
  30. run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
  31. - name: Install dependencies & build app
  32. run: |
  33. npm ci
  34. TESTING=true npm run build --if-present
  35. - name: Save context
  36. uses: actions/cache@v3
  37. with:
  38. key: cypress-context-${{ github.run_id }}
  39. path: /home/runner/work/server
  40. cypress:
  41. runs-on: ubuntu-latest
  42. needs: init
  43. strategy:
  44. fail-fast: false
  45. matrix:
  46. # run multiple copies of the current job in parallel
  47. containers: [1]
  48. name: runner ${{ matrix.containers }}
  49. steps:
  50. - name: Restore context
  51. uses: actions/cache@v3
  52. with:
  53. key: cypress-context-${{ github.run_id }}
  54. path: /home/runner/work/server
  55. - name: Run E2E cypress tests
  56. uses: cypress-io/github-action@v4
  57. with:
  58. record: true
  59. parallel: true
  60. # cypress env
  61. ci-build-id: ${{ github.sha }}-${{ github.run_number }}
  62. tag: ${{ github.event_name }}
  63. env:
  64. # Needs to be prefixed with CYPRESS_
  65. CYPRESS_BRANCH: ${{ env.BRANCH }}
  66. CYPRESS_GH: true
  67. # https://github.com/cypress-io/github-action/issues/124
  68. COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
  69. # Needed for some specific code workarounds
  70. TESTING: true
  71. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  72. CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
  73. summary:
  74. runs-on: ubuntu-latest
  75. needs: [init, cypress]
  76. if: always()
  77. name: cypress-summary
  78. steps:
  79. - name: Summary status
  80. run: if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi