90 lines
2.8 KiB
YAML
90 lines
2.8 KiB
YAML
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
|
|
- 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@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
|
|
with:
|
|
distribution: temurin
|
|
java-version: 17.0.6
|
|
|
|
- name: Login to GitHub package registry
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Gradle cache
|
|
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.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' }}
|