105 lines
3.0 KiB
YAML
105 lines
3.0 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:
|
|
publish:
|
|
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 longpaths
|
|
run: git config --system core.longpaths true
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up JDK 11 for running Gradle
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: adopt
|
|
java-version: 11
|
|
|
|
- name: Cache gradle dependencies
|
|
uses: burrunan/gradle-cache-action@v1.10
|
|
with:
|
|
job-id: matrix-smoke
|
|
read-only: true
|
|
|
|
- name: Cache Gradle Wrapper
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('smoke-tests/images/servlet/gradle/wrapper/gradle-wrapper.properties') }}
|
|
|
|
- name: Login to GitHub Package Registry
|
|
uses: docker/login-action@v1.10.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build Linux docker images
|
|
working-directory: smoke-tests/images/servlet
|
|
run: |
|
|
TAG="$(date '+%Y%m%d').$GITHUB_RUN_ID"
|
|
echo "Using extra tag $TAG"
|
|
./gradlew buildLinuxTestImages pushMatrix -PextraTag=$TAG -PsmokeTestServer=${{ matrix.smoke-test-server }}
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
- name: Build Windows docker images
|
|
working-directory: smoke-tests/images/servlet
|
|
run: |
|
|
TAG="$(date '+%Y%m%d').$GITHUB_RUN_ID"
|
|
echo "Using extra tag $TAG"
|
|
./gradlew buildWindowsTestImages pushMatrix -PextraTag=$TAG -PsmokeTestServer=${{ matrix.smoke-test-server }}
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
issue:
|
|
name: Open issue on failure
|
|
needs: publish
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
# run this action to get workflow conclusion
|
|
# You can get conclusion by env (env.WORKFLOW_CONCLUSION)
|
|
- uses: technote-space/workflow-conclusion-action@v2.2
|
|
|
|
- uses: actions/checkout@v2.3.4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: JasonEtco/create-an-issue@v2.6
|
|
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
filename: .github/templates/workflow-failed.md
|