From d9f8a1bf4e8bb147f85b7599dbef33e4515bca13 Mon Sep 17 00:00:00 2001 From: Peter Zaoral Date: Tue, 23 Jan 2024 09:43:31 +0100 Subject: [PATCH] Testing Keycloak with nightly Quarkus releases (#23407) Closes #23322 Signed-off-by: Peter Zaoral --- .github/scripts/prepare-quarkus-next.sh | 46 +++++++++++++++ .github/workflows/codeql-analysis.yml | 1 + .github/workflows/documentation.yml | 1 + .github/workflows/guides.yml | 1 + .github/workflows/js-ci.yml | 1 + .github/workflows/quarkus-next.yml | 58 +++++++++++++++++++ .../test-apps/spring-boot-adapter-app/pom.xml | 2 - 7 files changed, 108 insertions(+), 2 deletions(-) create mode 100755 .github/scripts/prepare-quarkus-next.sh create mode 100644 .github/workflows/quarkus-next.yml diff --git a/.github/scripts/prepare-quarkus-next.sh b/.github/scripts/prepare-quarkus-next.sh new file mode 100755 index 0000000000..c34d3e2f7e --- /dev/null +++ b/.github/scripts/prepare-quarkus-next.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -xeuo pipefail + +git checkout -b new-quarkus-next origin/main + +if ! grep -q '' pom.xml; then + sed -i '/<\/project>/i \ + \ + ' pom.xml +fi + +# Insert the element before the closing tag +sed -i '/<\/repositories>/i \ + \ + sonatype-snapshots \ + Sonatype Snapshots \ + https://s01.oss.sonatype.org/content/repositories/snapshots/ \ + \ + true \ + daily \ + \ + \ + false \ + \ + ' pom.xml + +./mvnw -B versions:set-property -Dproperty=quarkus.version -DnewVersion=999-SNAPSHOT +./mvnw -B versions:set-property -Dproperty=quarkus.build.version -DnewVersion=999-SNAPSHOT +git commit -am "Set quarkus version to 999-SNAPSHOT" + +snapshot_version_hash=$(git log origin/quarkus-next --grep="Set quarkus version to 999-SNAPSHOT" --format="%H" -n 1) +commits_to_cherry_pick=$(git rev-list --right-only --no-merges --reverse new-quarkus-next...origin/quarkus-next | grep -vE "$snapshot_version_hash" || echo "") + +if [ -z "$commits_to_cherry_pick" ]; then + echo "Nothing to cherry-pick." +else + for commit in $commits_to_cherry_pick + do + if git cherry-pick "$commit"; then + echo "Successfully cherry-picked $commit" + else + echo "Failed to cherry-pick $commit" + exit 1 + fi + done +fi \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cc55b27e72..ce95ab7762 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -5,6 +5,7 @@ on: branches-ignore: - main - dependabot/** + - quarkus-next pull_request: branches: [main] workflow_dispatch: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a5e032a9ab..9e4bb7b6d5 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -5,6 +5,7 @@ on: branches-ignore: - main - dependabot/** + - quarkus-next pull_request: workflow_dispatch: diff --git a/.github/workflows/guides.yml b/.github/workflows/guides.yml index deaade81a1..720398a37e 100644 --- a/.github/workflows/guides.yml +++ b/.github/workflows/guides.yml @@ -5,6 +5,7 @@ on: branches-ignore: - main - dependabot/** + - quarkus-next pull_request: workflow_dispatch: diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index 3dda2c4659..ca2bb4d7dd 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -5,6 +5,7 @@ on: branches-ignore: - main - dependabot/** + - quarkus-next pull_request: workflow_dispatch: diff --git a/.github/workflows/quarkus-next.yml b/.github/workflows/quarkus-next.yml new file mode 100644 index 0000000000..ec235fbf22 --- /dev/null +++ b/.github/workflows/quarkus-next.yml @@ -0,0 +1,58 @@ +name: Quarkus Next + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +defaults: + run: + shell: bash + +concurrency: + # Only cancel jobs for PR updates + group: quarkus-next-${{ github.ref }} + cancel-in-progress: true + +jobs: + update-quarkus-next-branch: + name: Update quarkus-next branch + if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + - name: Cherry-pick additional commits in quarkus-next + run: | + ${GITHUB_WORKSPACE}/.github/scripts/prepare-quarkus-next.sh + + - name: Push changes + run: | + git push -f origin HEAD:quarkus-next + + run-matrix-with-quarkus-next: + name: Run workflow matrix with the quarkus-next branch + runs-on: ubuntu-latest + needs: + - update-quarkus-next-branch + + strategy: + matrix: + workflow: + - ci.yml + - operator-ci.yml + + steps: + - name: Run workflow with the nightly Quarkus release + run: gh workflow run -R ${{ github.repository }} ${{ matrix.workflow }} -r quarkus-next + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml b/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml index 93a6711196..08ac13d183 100644 --- a/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml +++ b/testsuite/integration-arquillian/test-apps/spring-boot-adapter-app/pom.xml @@ -23,8 +23,6 @@ false keycloak-tomcat-adapter - - 5006 n