-
Notifications
You must be signed in to change notification settings - Fork 869
89 lines (78 loc) · 2.79 KB
/
publish-smoke-test-servlet-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Publish Servlet images for smoke tests
on:
push:
paths:
- "smoke-tests/images/servlet/**"
- ".github/workflows/publish-smoke-test-servlet-images.yml"
branches:
- main
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set-tag.outputs.TAG }}
steps:
- id: set-tag
name: Set tag
run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
publish:
needs: prepare
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # this is needed for TAG construction below on Windows
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
smoke-test-server:
- jetty
- liberty
- payara
- tomcat
- tomee
- websphere
- wildfly
exclude:
- os: windows-latest
smoke-test-server: websphere
fail-fast: false
steps:
- name: Support long paths
run: git config --system core.longpaths true
if: matrix.os == 'windows-latest'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Free disk space
if: matrix.os != 'windows-latest'
run: .github/scripts/gha-free-disk-space.sh
- name: Set up JDK for running Gradle
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
with:
distribution: temurin
java-version-file: .java-version
- name: Login to GitHub package registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Gradle cache
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
with:
# only push cache for one matrix option per OS since github action cache space is limited
cache-read-only: ${{ matrix.smoke-test-suite != 'tomcat' }}
- name: Build Linux docker images
if: matrix.os != 'windows-latest'
run: ./gradlew :smoke-tests:images:servlet:buildLinuxTestImages pushMatrix -PextraTag=${{ needs.prepare.outputs.tag }} -PsmokeTestServer=${{ matrix.smoke-test-server }}
- name: Build Windows docker images
if: matrix.os == 'windows-latest'
run: ./gradlew :smoke-tests:images:servlet:buildWindowsTestImages pushMatrix -PextraTag=${{ needs.prepare.outputs.tag }} -PsmokeTestServer=${{ matrix.smoke-test-server }}
workflow-notification:
needs:
- publish
if: always()
uses: ./.github/workflows/reusable-workflow-notification.yml
with:
success: ${{ needs.publish.result == 'success' }}