opentelemetry-java-instrume.../.github/workflows/publish-smoke-test-servlet-...

90 lines
2.6 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
- name: Set up JDK 11 for running Gradle
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
- 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: Set Tag
run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Build Linux docker images
if: matrix.os != 'windows-latest'
uses: gradle/gradle-build-action@v2
with:
arguments: buildLinuxTestImages pushMatrix -PextraTag=${{ env.TAG }} -PsmokeTestServer=${{ matrix.smoke-test-server }}
build-root-directory: smoke-tests/images/servlet
- name: Build Windows docker images
if: matrix.os == 'windows-latest'
uses: gradle/gradle-build-action@v2
with:
arguments: buildWindowsTestImages pushMatrix -PextraTag=${{ env.TAG }} -PsmokeTestServer=${{ matrix.smoke-test-server }}
build-root-directory: smoke-tests/images/servlet
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
- 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