Add integration tests to CI #686
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: Build Open Integration Engine | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| event_file: | |
| name: "Event File" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Event File | |
| path: ${{ github.event_path }} | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| alpine_server_image: ${{ steps.meta.outputs.alpine_server_image }} | |
| ubuntu_server_image: ${{ steps.meta.outputs.ubuntu_server_image }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set build metadata | |
| id: meta | |
| run: | | |
| echo "alpine_server_image=oie-ci-server:alpine-temurin21-${GITHUB_SHA}" >> "$GITHUB_OUTPUT" | |
| echo "ubuntu_server_image=oie-ci-server:ubuntu-temurin21-${GITHUB_SHA}" >> "$GITHUB_OUTPUT" | |
| if [ "${GITHUB_REF}" = "refs/heads/main" ]; then | |
| echo "ANT_BUILD_ARGS=" >> "$GITHUB_ENV" | |
| else | |
| echo "ANT_BUILD_ARGS=-DdisableSigning=true -Dcoverage=true" >> "$GITHUB_ENV" | |
| fi | |
| - name: Build Alpine production image | |
| run: | | |
| docker buildx build \ | |
| --progress=plain \ | |
| --build-arg "ANT_BUILD_ARGS=${ANT_BUILD_ARGS}" \ | |
| --cache-from type=gha,scope=oie-build \ | |
| --cache-to type=gha,scope=oie-build,mode=max \ | |
| --target jre-run \ | |
| -t "${{ steps.meta.outputs.alpine_server_image }}" \ | |
| --load \ | |
| . | |
| - name: Build Ubuntu production image | |
| run: | | |
| docker buildx build \ | |
| --progress=plain \ | |
| --build-arg "ANT_BUILD_ARGS=${ANT_BUILD_ARGS}" \ | |
| --cache-from type=gha,scope=oie-build \ | |
| --cache-to type=gha,scope=oie-build,mode=max \ | |
| --target jdk-run \ | |
| -t "${{ steps.meta.outputs.ubuntu_server_image }}" \ | |
| --load \ | |
| . | |
| - name: Export build artifacts and test results | |
| run: | | |
| rm -rf docker-build-output | |
| docker buildx build \ | |
| --progress=plain \ | |
| --build-arg "ANT_BUILD_ARGS=${ANT_BUILD_ARGS}" \ | |
| --cache-from type=gha,scope=oie-build \ | |
| --cache-to type=gha,scope=oie-build,mode=max \ | |
| --target build-output-export \ | |
| --output type=local,dest=docker-build-output \ | |
| . | |
| - name: Package distribution | |
| run: tar czf openintegrationengine.tar.gz -C docker-build-output/app/server setup --transform 's|^setup|openintegrationengine/|' | |
| - name: Create artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: oie-build | |
| path: openintegrationengine.tar.gz | |
| - name: Save Alpine server image | |
| run: docker save "${{ steps.meta.outputs.alpine_server_image }}" | gzip > oie-server-image-alpine-temurin21.tar.gz | |
| - name: Upload Alpine server image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: oie-server-image-alpine-temurin21 | |
| path: oie-server-image-alpine-temurin21.tar.gz | |
| - name: Save Ubuntu server image | |
| run: docker save "${{ steps.meta.outputs.ubuntu_server_image }}" | gzip > oie-server-image-ubuntu-temurin21.tar.gz | |
| - name: Upload Ubuntu server image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: oie-server-image-ubuntu-temurin21 | |
| path: oie-server-image-ubuntu-temurin21.tar.gz | |
| - name: Stage Test Results | |
| if: (!cancelled()) | |
| run: | | |
| mkdir -p aggregate-test-results | |
| cp -r --parents docker-build-output/app/client/build/test-results aggregate-test-results/ | |
| cp -r --parents docker-build-output/app/command/build/test-results aggregate-test-results/ | |
| cp -r --parents docker-build-output/app/donkey/build/test-results aggregate-test-results/ | |
| cp -r --parents docker-build-output/app/server/build/test-results aggregate-test-results/ | |
| - name: Upload Test Results | |
| if: (!cancelled()) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Test Results | |
| path: | | |
| aggregate-test-results/**/*.xml | |
| docker_smoke: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| configuration: | |
| - alpine-temurin21-derby | |
| - alpine-temurin21-mysql | |
| - alpine-temurin21-postgres | |
| - alpine-temurin21-sqlserver | |
| - ubuntu-temurin21-derby | |
| - ubuntu-temurin21-postgres | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download server image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ startsWith(matrix.configuration, 'ubuntu-') && 'oie-server-image-ubuntu-temurin21' || 'oie-server-image-alpine-temurin21' }} | |
| - name: Load server image | |
| run: | | |
| IMAGE_ARCHIVE="${{ startsWith(matrix.configuration, 'ubuntu-') && 'oie-server-image-ubuntu-temurin21.tar.gz' || 'oie-server-image-alpine-temurin21.tar.gz' }}" | |
| gunzip -c "$IMAGE_ARCHIVE" | docker load | |
| - name: Build runner image | |
| run: docker build --progress=plain -t oie-ci-runner:${{ github.sha }} ci/runner | |
| - name: Boot and tear down configuration | |
| run: | | |
| docker run --rm \ | |
| --add-host host.docker.internal:host-gateway \ | |
| -v /var/run/docker.sock:/var/run/docker.sock \ | |
| -v "$GITHUB_WORKSPACE:/workspace" \ | |
| oie-ci-runner:${{ github.sha }} \ | |
| --workspace /workspace \ | |
| --configuration "${{ matrix.configuration }}" \ | |
| --server-image "${{ startsWith(matrix.configuration, 'ubuntu-') && needs.build.outputs.ubuntu_server_image || needs.build.outputs.alpine_server_image }}" \ | |
| --results-root ci/test-results | |
| - name: Upload Docker Smoke Test Results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Test Results Docker Smoke - ${{ matrix.configuration }} | |
| path: | | |
| ci/test-results/**/*.xml | |