Feat/idle timeouts (#3046) #451
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
| # | |
| # Licensed to the Apache Software Foundation (ASF) under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # The ASF licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| name: "Build Kroxylicious Proxy" | |
| on: | |
| push: | |
| branches: [ main, 'release/**' ] | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_proxy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: | |
| - distro: 'temurin' | |
| version: '21' | |
| - distro: 'corretto' | |
| version: '25' | |
| steps: | |
| - name: 'Test for Sonar secret' | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| echo "SONAR_TOKEN_SET=$(test ${SONAR_TOKEN} && echo true)" >> $GITHUB_ENV | |
| - name: 'Test for Slack secret' | |
| env: | |
| KROXYLICIOUS_SLACK_WEBHOOK: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }} | |
| run: | | |
| echo "SLACK_WEBHOOK_SET=$(test ${KROXYLICIOUS_SLACK_WEBHOOK} && echo true)" >> $GITHUB_ENV | |
| - name: 'Check out repository' | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 | |
| - name: 'Set up Java' | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ matrix.java.version }} | |
| distribution: ${{ matrix.java.distro }} | |
| - name: Setup Minikube | |
| uses: manusa/actions-setup-minikube@b589f2d61bf96695c546929c72b38563e856059d | |
| with: | |
| minikube version: 'v1.35.0' | |
| kubernetes version: 'v1.32.0' | |
| github token: ${{ secrets.GITHUB_TOKEN }} | |
| driver: docker | |
| - name: 'Test for unpublished reference release (japicmp)' | |
| run: | | |
| REFERENCE_RELEASE=$(mvn --quiet -pl kroxylicious-api help:evaluate -Dexpression=ApiCompatability.ReferenceVersion -DforceStdout) | |
| echo "REFERENCE_RELEASE_UNPUBLISHED=$(mvn --quiet dependency:get -Dartifact=io.kroxylicious:kroxylicious-parent:${REFERENCE_RELEASE}:pom 1>/dev/null && echo false || echo true)" >> $GITHUB_ENV | |
| - name: 'Cache Maven packages' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: 'Build & unit test Kroxylicious proxy' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| GIT_HASH="$(git rev-parse HEAD)" | |
| IMAGE_TAG="dev-git-${GIT_HASH}" | |
| KROXYLICIOUS_VERSION="$(mvn org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=project.version -q -DforceStdout)" | |
| KROXYLICIOUS_IMAGE="quay.io/kroxylicious/kroxylicious:${IMAGE_TAG}" | |
| echo "KROXYLICIOUS_VERSION=${KROXYLICIOUS_VERSION}" >> "$GITHUB_ENV" | |
| # KROXYLICIOUS_IMAGE env var is used by the Operator ITs | |
| echo "KROXYLICIOUS_IMAGE=${KROXYLICIOUS_IMAGE}" >> "$GITHUB_ENV" | |
| mvn -B install -DskipITs -Pci -Djapicmp.skip=${REFERENCE_RELEASE_UNPUBLISHED} | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v5 | |
| if: github.ref_name == 'main' || env.SONAR_TOKEN_SET == 'true' | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: 'Build Kroxylicious maven project on main with Sonar' | |
| if: github.event_name == 'push' && github.ref_name == 'main' && env.SONAR_TOKEN_SET == 'true' | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT: ${{ vars.KROXYLICIOUS_KMS_FORTANIX_API_ENDPOINT }} | |
| KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_ADMIN_API_KEY }} | |
| KROXYLICIOUS_KMS_FORTANIX_API_KEY: ${{ secrets.KROXYLICIOUS_KMS_FORTANIX_API_KEY }} | |
| run: mvn -B verify -Pci -Djapicmp.skip=${REFERENCE_RELEASE_UNPUBLISHED} org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar -pl ''!:kroxylicious-operator'' | |
| - name: Slack Notification on Failure | |
| if: failure() && env.SLACK_WEBHOOK_SET == 'true' | |
| uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2 | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.KROXYLICIOUS_SLACK_WEBHOOK }} | |
| SLACK_COLOR: 'danger' | |
| SLACK_TITLE: 'Failure Alert: ${{ github.repository }}' | |
| SLACK_MESSAGE: 'The maven workflow failed on branch ${{ github.ref_name }}.' |