Fix flakiness in overview page by awaiting kafkaCluster before render… #8898
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 | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - '[0-9]+.[0-9]+.x' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - '[0-9]+.[0-9]+.x' | |
| - 'systemtests' | |
| types: [ opened, reopened, synchronize ] | |
| jobs: | |
| build-images: | |
| runs-on: ubuntu-24.04 | |
| services: | |
| registry: | |
| image: registry:2 | |
| ports: | |
| - 5000:5000 | |
| env: | |
| PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x | |
| steps: | |
| # ==================== Setup ==================== | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set Image Tag Env | |
| run: echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Operator Version Check | |
| run: ./operator/bin/version-check.sh "${{ env.PROJECT_VERSION }}" | |
| - name: Fetch Operator Framework Utilities | |
| run: ./operator/bin/fetch-operator-utilities.sh | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Cache Maven Packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache Next.js UI Build | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.npm | |
| ${{ github.workspace }}/.next/cache | |
| # Generate a new cache whenever packages or source files change. | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
| # If source files changed but packages didn't, rebuild from a prior cache. | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
| - name: Set Up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set Up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| with: | |
| driver-opts: network=host | |
| # ==================== UI ==================== | |
| - name: Build UI Project | |
| working-directory: ui | |
| run: | | |
| npm ci --omit=dev | |
| npm run build | |
| - name: Build UI Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ui/ | |
| platforms: ${{ env.PLATFORMS }} | |
| provenance: false | |
| push: true | |
| tags: | | |
| localhost:5000/streamshub/console-ui:${{ env.PROJECT_VERSION }} | |
| # ==================== API & Operator ==================== | |
| - name: Build API and Operator Images | |
| run: | | |
| export QUARKUS_CONTAINER_IMAGE_REGISTRY="localhost:5000" | |
| export QUARKUS_CONTAINER_IMAGE_PUSH=true | |
| export QUARKUS_CONTAINER_IMAGE_TAG="${{ env.PROJECT_VERSION }}" | |
| export QUARKUS_KUBERNETES_VERSION="${{ env.PROJECT_VERSION }}" | |
| mvn verify -P container-image -B --no-transfer-progress -DskipTests \ | |
| -Dquarkus.kubernetes.namespace='$${NAMESPACE}' \ | |
| -Dquarkus.docker.buildx.platform=${{ env.PLATFORMS }} | |
| # ==================== Operator-Bundle ==================== | |
| - name: Modify Bundle CSV Metadata | |
| run: ./operator/bin/modify-bundle-metadata.sh "VERSION=${{ env.PROJECT_VERSION }}" "PLATFORMS=${{ env.PLATFORMS }}" | |
| - name: Build Operator Bundle Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: operator/target/bundle/streamshub-console-operator/ | |
| platforms: ${{ env.PLATFORMS }} | |
| provenance: false | |
| push: true | |
| file: operator/target/bundle/streamshub-console-operator/bundle.Dockerfile | |
| tags: | | |
| localhost:5000/streamshub/console-operator-bundle:${{ env.PROJECT_VERSION }} | |
| # ==================== Operator-Catalog ==================== | |
| - name: Generate Operator Catalog Config | |
| run: | | |
| operator/bin/generate-catalog.sh localhost:5000/streamshub/console-operator-bundle true | |
| - name: Build Operator Catalog Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: operator/ | |
| platforms: ${{ env.PLATFORMS }} | |
| network: none | |
| provenance: false | |
| push: true | |
| file: operator/src/main/docker/catalog.Dockerfile | |
| tags: | | |
| localhost:5000/streamshub/console-operator-catalog:${{ env.PROJECT_VERSION }} | |
| # ==================== Archive artifacts ==================== | |
| - name: Archive Operator Kubernetes Resources | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: k8s-resources | |
| path: | | |
| operator/target/bundle/ | |
| operator/target/catalog/ | |
| operator/target/kubernetes/*.yml | |
| - name: Save [UI, API, Operator, Operator-Bundle, Operator-Catalog] Images To Files | |
| run: | | |
| mkdir streamshub-images | |
| for img in console-ui console-api console-operator console-operator-bundle console-operator-catalog ; do | |
| skopeo sync --all --scoped --src docker --src-tls-verify=false --dest dir \ | |
| localhost:5000/streamshub/${img}:${{ env.PROJECT_VERSION }} \ | |
| $(pwd)/streamshub-images | |
| done | |
| tar -czf streamshub-images.tgz -C streamshub-images . | |
| - name: Archive [UI, API, Operator-Bundle, Operator, Operator-Catalog] Image Files | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: streamshub-images | |
| path: streamshub-images.tgz | |
| test-java: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Cache Maven Packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Test API and Operator | |
| run: | | |
| # | |
| # Set write-transformed-bytecode-to-build-output for IT coverage. Do NOT use the container image | |
| # created by this step. | |
| # | |
| # See: https://quarkus.io/guides/tests-with-coverage#coverage-for-integration-tests | |
| # | |
| mvn verify -B --no-transfer-progress -DskipSTs \ | |
| -Dquarkus.package.write-transformed-bytecode-to-build-output=true | |
| - name: Archive Failed Tests Results | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: artifacts | |
| path: | | |
| **/target/failsafe-reports/ | |
| **/target/surefire-reports/ | |
| ## Save the context information for use in Sonar analysis | |
| - name: Save Build Context | |
| run: | | |
| mkdir -vp target | |
| echo "$GITHUB_CONTEXT" > target/build-context.json | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| ## Attach the target directory for use in Sonar analysis | |
| - name: Archive Build Output | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: target | |
| path: | | |
| **/target/ | |
| !**/target/**/*.jar | |
| !**/target/failsafe-reports/**/* | |
| !**/target/surefire-reports/**/* | |
| test-storybook: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Build Storybook | |
| working-directory: ./ui | |
| run: | | |
| npm ci | |
| npx playwright install | |
| npm run build-storybook | |
| - name: Test Storybook | |
| working-directory: ./ui | |
| run: | | |
| npx --yes concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
| "npx http-server storybook-static --port 6006 --silent" \ | |
| "npx wait-on tcp:127.0.0.1:6006 && npm run test-storybook" | |
| Playwright: | |
| if: ${{ contains(github.event.pull_request.labels.*.name, 'safe to test') || github.repository == 'streamshub/console' }} | |
| uses: ./.github/workflows/playwright-tests.yml | |
| needs: | |
| - build-images |