e2e-checks.yaml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: "E2E: PR healthcheck"
  2. on:
  3. pull_request_target:
  4. types: [ "opened", "edited", "reopened", "synchronize" ]
  5. paths:
  6. - "kafka-ui-api/**"
  7. - "kafka-ui-contract/**"
  8. - "kafka-ui-react-app/**"
  9. - "kafka-ui-e2e-checks/**"
  10. - "pom.xml"
  11. permissions:
  12. statuses: write
  13. jobs:
  14. build-and-test:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v3
  18. with:
  19. ref: ${{ github.event.pull_request.head.sha }}
  20. - name: Configure AWS credentials
  21. uses: aws-actions/configure-aws-credentials@v3
  22. with:
  23. aws-access-key-id: ${{ secrets.S3_AWS_ACCESS_KEY_ID }}
  24. aws-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
  25. aws-region: eu-central-1
  26. - name: Set up environment
  27. id: set_env_values
  28. run: |
  29. cat "./kafka-ui-e2e-checks/.env.ci" >> "./kafka-ui-e2e-checks/.env"
  30. - name: Pull with Docker
  31. id: pull_chrome
  32. run: |
  33. docker pull selenoid/vnc_chrome:103.0
  34. - name: Set up JDK
  35. uses: actions/setup-java@v3
  36. with:
  37. java-version: '17'
  38. distribution: 'zulu'
  39. cache: 'maven'
  40. - name: Build with Maven
  41. id: build_app
  42. run: |
  43. ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
  44. ./mvnw -B -V -ntp clean install -Pprod -Dmaven.test.skip=true ${{ github.event.inputs.extraMavenOptions }}
  45. - name: Compose with Docker
  46. id: compose_app
  47. # use the following command until #819 will be fixed
  48. run: |
  49. docker-compose -f kafka-ui-e2e-checks/docker/selenoid-git.yaml up -d
  50. docker-compose -f ./documentation/compose/e2e-tests.yaml up -d && until [ "$(docker exec kafka-ui wget --spider --server-response http://localhost:8080/actuator/health 2>&1 | grep -c 'HTTP/1.1 200 OK')" == "1" ]; do echo "Waiting for kafka-ui ..." && sleep 1; done
  51. - name: Run test suite
  52. run: |
  53. ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
  54. ./mvnw -B -V -ntp -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -f 'kafka-ui-e2e-checks' test -Pprod
  55. - name: Generate allure report
  56. uses: simple-elf/allure-report-action@master
  57. if: always()
  58. id: allure-report
  59. with:
  60. allure_results: ./kafka-ui-e2e-checks/allure-results
  61. gh_pages: allure-results
  62. allure_report: allure-report
  63. subfolder: allure-results
  64. report_url: "http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com"
  65. - uses: jakejarvis/s3-sync-action@master
  66. if: always()
  67. env:
  68. AWS_S3_BUCKET: 'kafkaui-allure-reports'
  69. AWS_REGION: 'eu-central-1'
  70. SOURCE_DIR: 'allure-history/allure-results'
  71. - name: Deploy report to Amazon S3
  72. if: always()
  73. uses: Sibz/github-status-action@v1.1.6
  74. with:
  75. authToken: ${{secrets.GITHUB_TOKEN}}
  76. context: "Click Details button to open Allure report"
  77. state: "success"
  78. sha: ${{ github.event.pull_request.head.sha || github.sha }}
  79. target_url: http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com/${{ github.run_number }}
  80. - name: Dump docker logs on failure
  81. if: failure()
  82. uses: jwalton/gh-docker-logs@v2.2.1