publish-smoke-test-servlet-images.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. name: Publish Servlet images for smoke tests
  2. on:
  3. push:
  4. paths:
  5. - 'smoke-tests/images/servlet/**'
  6. - '.github/workflows/publish-smoke-test-servlet-images.yml'
  7. branches:
  8. - main
  9. workflow_dispatch:
  10. jobs:
  11. publish:
  12. runs-on: ${{ matrix.os }}
  13. defaults:
  14. run:
  15. shell: bash # this is needed for TAG construction below on Windows
  16. strategy:
  17. matrix:
  18. os:
  19. - windows-latest
  20. - ubuntu-latest
  21. smoke-test-server:
  22. - jetty
  23. - liberty
  24. - payara
  25. - tomcat
  26. - tomee
  27. - websphere
  28. - wildfly
  29. exclude:
  30. - os: windows-latest
  31. smoke-test-server: websphere
  32. fail-fast: false
  33. steps:
  34. - name: Support longpaths
  35. run: git config --system core.longpaths true
  36. if: matrix.os == 'windows-latest'
  37. - uses: actions/checkout@v2.3.4
  38. with:
  39. fetch-depth: 0
  40. - name: Set up JDK 11 for running Gradle
  41. uses: actions/setup-java@v2
  42. with:
  43. distribution: adopt
  44. java-version: 11
  45. - name: Cache gradle dependencies
  46. uses: burrunan/gradle-cache-action@v1.10
  47. with:
  48. job-id: matrix-smoke
  49. read-only: true
  50. - name: Cache Gradle Wrapper
  51. uses: actions/cache@v2
  52. with:
  53. path: ~/.gradle/wrapper
  54. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('smoke-tests/images/servlet/gradle/wrapper/gradle-wrapper.properties') }}
  55. - name: Login to GitHub Package Registry
  56. uses: docker/login-action@v1.10.0
  57. with:
  58. registry: ghcr.io
  59. username: ${{ github.repository_owner }}
  60. password: ${{ secrets.GITHUB_TOKEN }}
  61. - name: Build Linux docker images
  62. working-directory: smoke-tests/images/servlet
  63. run: |
  64. TAG="$(date '+%Y%m%d').$GITHUB_RUN_ID"
  65. echo "Using extra tag $TAG"
  66. ./gradlew buildLinuxTestImages pushMatrix -PextraTag=$TAG -PsmokeTestServer=${{ matrix.smoke-test-server }}
  67. if: matrix.os != 'windows-latest'
  68. - name: Build Windows docker images
  69. working-directory: smoke-tests/images/servlet
  70. run: |
  71. TAG="$(date '+%Y%m%d').$GITHUB_RUN_ID"
  72. echo "Using extra tag $TAG"
  73. ./gradlew buildWindowsTestImages pushMatrix -PextraTag=$TAG -PsmokeTestServer=${{ matrix.smoke-test-server }}
  74. if: matrix.os == 'windows-latest'
  75. issue:
  76. name: Open issue on failure
  77. needs: publish
  78. runs-on: ubuntu-latest
  79. if: always()
  80. steps:
  81. # run this action to get workflow conclusion
  82. # You can get conclusion by env (env.WORKFLOW_CONCLUSION)
  83. - uses: technote-space/workflow-conclusion-action@v2.2
  84. - uses: actions/checkout@v2.3.4
  85. with:
  86. fetch-depth: 0
  87. - uses: JasonEtco/create-an-issue@v2.6
  88. if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
  89. env:
  90. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  91. with:
  92. filename: .github/templates/workflow-failed.md