app_tests_internal_tools.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. on:
  2. workflow_run:
  3. workflows: ["Deploy Porter to Internal Tooling"]
  4. branches: [master]
  5. types:
  6. - completed
  7. env:
  8. REPO: porter
  9. STAGE: internal-tools
  10. PROJECT: "301"
  11. CLUSTER: "142"
  12. HOST: https://dashboard.internal-tools.porter.run
  13. TOKEN: ${{ secrets.APP_INTEGRATION_PROJECT_TOKEN }}
  14. SLACK_WEBHOOK_URL: ${{ secrets.APP_INTEGRATION_SLACK_WEBHOOK }}
  15. name: Run internal tools app tests
  16. jobs:
  17. integration-tests:
  18. name: Run app tests
  19. runs-on: ubuntu-latest
  20. strategy:
  21. matrix:
  22. yaml: ['js-test-app-buildpack', 'js-test-app-dockerfile', 'nginx', 'next-test-app-dockerfile']
  23. fail-fast: false
  24. steps:
  25. - name: Checkout code
  26. uses: actions/checkout@v4
  27. with:
  28. repository: porter-dev/app-integration-tests
  29. ref: refs/heads/main
  30. - name: Run test
  31. uses: ./.github/actions
  32. with:
  33. host: $HOST
  34. project: $PROJECT
  35. cluster: $CLUSTER
  36. token: $TOKEN
  37. yaml_file: ./test-yamls/${{ matrix.yaml }}.yaml
  38. app_name: $REPO-${{ matrix.yaml }}
  39. notify-on-failure:
  40. name: Notify on failure
  41. needs: integration-tests
  42. runs-on: ubuntu-latest
  43. if: failure()
  44. steps:
  45. - name: Notify Slack on failure
  46. env:
  47. SLACK_WEBHOOK_URL: $SLACK_WEBHOOK_URL
  48. RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  49. run: |
  50. curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"<!subteam^S05LXJ5DU9L> \`$REPO\` integration tests failed in \`$STAGE\`: $RUN_URL \"}" $SLACK_WEBHOOK_URL