publish-smoke-test-fake-backend-images.yml 3.3 KB

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