Skip to content

image_updated

image_updated #859

name: Java CI on Repository Dispatch
on:
repository_dispatch:
branches: [main]
types: image_updated
jobs:
java-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
distribution: ["adopt"]
java-version: [11]
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: actions/setup-java@v2
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }}
cache: "gradle"
- uses: gradle/wrapper-validation-action@v1
- name: check Java code format
run: |
./gradlew spotlessJavaCheck
./gradlew spotlessGroovyGradleCheck
- run: |
if [ "${{ github.event.client_payload.image }}" != '' ]; then
export HSTREAM_IMAGE_NAME="${{ github.event.client_payload.image }}"
fi
./gradlew :app:test --info
- uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: logs-artifact
path: |
.logs
app/build/reports
- name: Post to Slack channel
if: ${{ success() }} || ${{ failure() }}
run: |
if [ "${{ job.status }}" = 'success' ]
then JOB_STATUS_EMOJI=':white_check_mark:'
else JOB_STATUS_EMOJI=':x:'
fi
curl \
-X POST \
-H 'Content-Type: application/json' \
${{ secrets.SLACK_TEST_RESULTS_HOOK_URL }} \
--data "{\"data\": \"GitHub Action build result: ${{ job.status }} "$JOB_STATUS_EMOJI"\n\
Commit info: https://github.com/hstreamdb/hstream/commit/${{ github.event.client_payload.commit_sha }}\n\
Action summary: https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}"