|
| 1 | +# -------------------------------------------------------------------- |
| 2 | +# Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). |
| 3 | +# |
| 4 | +# WSO2 LLC. licenses this file to you under the Apache License, |
| 5 | +# Version 2.0 (the "License"); you may not use this file except |
| 6 | +# in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | +# -------------------------------------------------------------------- |
| 18 | + |
| 19 | +name: Event Gateway Integration Test |
| 20 | + |
| 21 | +on: |
| 22 | + workflow_dispatch: |
| 23 | + pull_request: |
| 24 | + branches: |
| 25 | + - main |
| 26 | + paths: |
| 27 | + - 'event-gateway/**' |
| 28 | + - 'gateway/gateway-controller/**' |
| 29 | + - 'common/**' |
| 30 | + - 'sdk/**' |
| 31 | + - '.github/workflows/event-gateway-integration-test.yml' |
| 32 | + |
| 33 | +concurrency: |
| 34 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} |
| 35 | + cancel-in-progress: true |
| 36 | + |
| 37 | +jobs: |
| 38 | + integration-test: |
| 39 | + runs-on: ubuntu-24.04 |
| 40 | + steps: |
| 41 | + - name: Checkout code |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Set up Go |
| 45 | + uses: actions/setup-go@v5 |
| 46 | + with: |
| 47 | + go-version: '1.26.2' |
| 48 | + cache-dependency-path: '**/go.sum' |
| 49 | + |
| 50 | + - name: Set up Docker Buildx |
| 51 | + uses: docker/setup-buildx-action@v3 |
| 52 | + |
| 53 | + - name: Read version |
| 54 | + id: version |
| 55 | + run: echo "version=$(cat event-gateway/VERSION)" >> $GITHUB_OUTPUT |
| 56 | + |
| 57 | + - name: Build event-gateway-controller image |
| 58 | + run: make -C event-gateway build-event-gateway-controller VERSION=${{ steps.version.outputs.version }} |
| 59 | + |
| 60 | + - name: Build event-gateway-runtime image |
| 61 | + run: make -C event-gateway build-gateway-runtime VERSION=${{ steps.version.outputs.version }} |
| 62 | + |
| 63 | + - name: Run integration tests |
| 64 | + run: make -C event-gateway/it test |
| 65 | + |
| 66 | + - name: Upload compose logs |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + if: always() |
| 69 | + with: |
| 70 | + name: compose-logs |
| 71 | + path: event-gateway/it/logs/ |
| 72 | + retention-days: 7 |
| 73 | + |
| 74 | + - name: Debug on failure - Dump logs |
| 75 | + if: failure() |
| 76 | + run: | |
| 77 | + echo "=== Docker Containers ===" |
| 78 | + docker ps -a |
| 79 | +
|
| 80 | + echo "" |
| 81 | + echo "=== event-gateway/it/logs Directory Contents ===" |
| 82 | + if [ -d event-gateway/it/logs ]; then |
| 83 | + if [ "$(ls -A event-gateway/it/logs)" ]; then |
| 84 | + for f in event-gateway/it/logs/*; do |
| 85 | + echo "" |
| 86 | + echo "--- Contents of $f ---" |
| 87 | + cat "$f" |
| 88 | + done |
| 89 | + else |
| 90 | + echo "No log files found in event-gateway/it/logs." |
| 91 | + fi |
| 92 | + else |
| 93 | + echo "Directory event-gateway/it/logs does not exist." |
| 94 | + fi |
0 commit comments