2
0

app_tests_base.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. on:
  2. workflow_call:
  3. inputs:
  4. stage:
  5. required: true
  6. type: string
  7. project:
  8. required: true
  9. type: string
  10. cluster:
  11. required: true
  12. type: string
  13. host:
  14. required: true
  15. type: string
  16. secrets:
  17. token:
  18. required: true
  19. slack_webhook_url:
  20. required: true
  21. env:
  22. repo: porter
  23. name: Run app tests
  24. jobs:
  25. integration-tests:
  26. name: Run app tests
  27. runs-on: ubuntu-latest
  28. timeout-minutes: 7
  29. strategy:
  30. matrix:
  31. yaml: ['js-test-app-buildpack', 'js-test-app-dockerfile', 'nginx', 'next-test-app-dockerfile']
  32. fail-fast: false
  33. steps:
  34. - name: Checkout code
  35. uses: actions/checkout@v4
  36. with:
  37. repository: porter-dev/app-integration-tests
  38. ref: refs/heads/main
  39. - name: Run test
  40. uses: ./.github/actions
  41. with:
  42. host: ${{ inputs.host }}
  43. project: ${{ inputs.project }}
  44. cluster: ${{ inputs.cluster }}
  45. token: ${{ secrets.token }}
  46. yaml_file: ./test-yamls/${{ matrix.yaml }}.yaml
  47. app_name: ${{ env.repo }}-${{ matrix.yaml }}
  48. notify-on-failure:
  49. name: Notify on failure
  50. needs: integration-tests
  51. runs-on: ubuntu-latest
  52. if: failure()
  53. steps:
  54. - name: Notify Slack on failure
  55. env:
  56. RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  57. run: |
  58. curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"<!subteam^S05MGRLKF33> \`${{ env.repo }}\` integration tests failed in \`${{ inputs.STAGE }}\`: $RUN_URL \"}" ${{ secrets.slack_webhook_url }}