app_tests_base.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. strategy:
  29. matrix:
  30. yaml: ['js-test-app-buildpack', 'js-test-app-dockerfile', 'nginx', 'next-test-app-dockerfile']
  31. fail-fast: false
  32. steps:
  33. - name: Checkout code
  34. uses: actions/checkout@v4
  35. with:
  36. repository: porter-dev/app-integration-tests
  37. ref: refs/heads/main
  38. - name: Run test
  39. uses: ./.github/actions
  40. with:
  41. host: ${{ inputs.host }}
  42. project: ${{ inputs.project }}
  43. cluster: ${{ inputs.cluster }}
  44. token: ${{ secrets.token }}
  45. yaml_file: ./test-yamls/${{ matrix.yaml }}.yaml
  46. app_name: ${{ env.repo }}-${{ matrix.yaml }}
  47. notify-on-failure:
  48. name: Notify on failure
  49. needs: integration-tests
  50. runs-on: ubuntu-latest
  51. if: failure()
  52. steps:
  53. - name: Notify Slack on failure
  54. env:
  55. RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  56. run: |
  57. curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"<!subteam^S05LXJ5DU9L> \`${{ env.repo }}\` integration tests failed in \`${{ inputs.STAGE }}\`: $RUN_URL \"}" ${{ secrets.slack_webhook_url }}