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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. prepare:
  12. runs-on: ubuntu-latest
  13. outputs:
  14. tag: ${{ steps.set-tag.outputs.TAG }}
  15. steps:
  16. - id: set-tag
  17. name: Set tag
  18. run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
  19. publish:
  20. needs: prepare
  21. runs-on: ${{ matrix.os }}
  22. defaults:
  23. run:
  24. shell: bash # this is needed for TAG construction below on Windows
  25. strategy:
  26. matrix:
  27. os:
  28. - windows-latest
  29. - ubuntu-latest
  30. smoke-test-server:
  31. - jetty
  32. - liberty
  33. - payara
  34. - tomcat
  35. - tomee
  36. - websphere
  37. - wildfly
  38. exclude:
  39. - os: windows-latest
  40. smoke-test-server: websphere
  41. fail-fast: false
  42. steps:
  43. - name: Support long paths
  44. run: git config --system core.longpaths true
  45. if: matrix.os == 'windows-latest'
  46. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  47. - name: Free disk space
  48. if: matrix.os != 'windows-latest'
  49. run: .github/scripts/gha-free-disk-space.sh
  50. - name: Set up JDK for running Gradle
  51. uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
  52. with:
  53. distribution: temurin
  54. java-version-file: .java-version
  55. - name: Login to GitHub package registry
  56. uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
  57. with:
  58. registry: ghcr.io
  59. username: ${{ github.repository_owner }}
  60. password: ${{ secrets.GITHUB_TOKEN }}
  61. - name: Set up Gradle cache
  62. uses: gradle/actions/setup-gradle@d9336dac04dea2507a617466bc058a3def92b18b # v3.4.0
  63. with:
  64. # only push cache for one matrix option per OS since github action cache space is limited
  65. cache-read-only: ${{ matrix.smoke-test-suite != 'tomcat' }}
  66. - name: Build Linux docker images
  67. if: matrix.os != 'windows-latest'
  68. run: ./gradlew :smoke-tests:images:servlet:buildLinuxTestImages pushMatrix -PextraTag=${{ needs.prepare.outputs.tag }} -PsmokeTestServer=${{ matrix.smoke-test-server }}
  69. - name: Build Windows docker images
  70. if: matrix.os == 'windows-latest'
  71. run: ./gradlew :smoke-tests:images:servlet:buildWindowsTestImages pushMatrix -PextraTag=${{ needs.prepare.outputs.tag }} -PsmokeTestServer=${{ matrix.smoke-test-server }}
  72. workflow-notification:
  73. needs:
  74. - publish
  75. if: always()
  76. uses: ./.github/workflows/reusable-workflow-notification.yml
  77. with:
  78. success: ${{ needs.publish.result == 'success' }}