Add golden e2e tests for ibm-mq-metrics #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run End to End tests for IBM MQ Metrics | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - ibm-mq-metrics/** | ||
| pull_request: | ||
| paths: | ||
| - ibm-mq-metrics/** | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| e2e: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Cache Docker images. | ||
| uses: AndreKurait/docker-cache@0fe76702a40db986d9663c24954fc14c6a6031b7 # 0.6.0 | ||
| with: | ||
| key: docker-mq-e2e | ||
| - name: Checkout code | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - name: Set up JDK for running Gradle | ||
| uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 | ||
| with: | ||
| distribution: temurin | ||
| java-version: 11 | ||
| - name: Set up gradle | ||
| uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2 | ||
| with: | ||
| cache-read-only: ${{ github.event_name == 'pull_request' }} | ||
| - name: Build the jar | ||
| run: | | ||
| ./gradlew ibm-mq-metrics:clean ibm-mq-metrics:shadowJar | ||
| - name: Make a local copy of the ibm client jar | ||
| run: | | ||
| ./gradlew ibm-mq-metrics:copyIbmClientJar | ||
| - name: Start MQ and the test services | ||
| run: | | ||
| cd ibm-mq-metrics/golden | ||
| docker compose up -d --wait | ||
| - name: Run the integration | ||
| run: | | ||
| cd ibm-mq-metrics/golden | ||
| ./run.sh & | ||
| exit_code=$(docker wait golden) | ||
| docker logs golden | ||
| if [ "$exit_code" -ne 0 ]; then | ||
| exit 1 | ||
| fi | ||
| - name: Notify failed build | ||
| uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b # v1.2.0 | ||
| if: failure() && github.event.pull_request == null | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||