From 84da543004010b9669f95b8855226efca0d29366 Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Sun, 21 Jun 2026 12:00:03 -0300 Subject: [PATCH 1/3] ci: migrate from CircleCI to GitHub Actions with cached core-jar build Signed-off-by: Marvin Froeder --- .circleci/config.yml | 540 ------------------------- .github/actions/setup-build/action.yml | 47 +++ {.circleci => .github}/settings.xml | 16 - .github/workflows/build-and-test.yml | 454 +++++++++++++++++++++ .github/workflows/deploy.yml | 66 +++ 5 files changed, 567 insertions(+), 556 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/actions/setup-build/action.yml rename {.circleci => .github}/settings.xml (54%) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3e15ab7c83..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,540 +0,0 @@ -# -# Copyright 2012-2020 The Feign Authors -# -# Licensed 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. -# - -# common executors -executors: - java: - docker: - - image: velo/toolchains-4-ci-builds:with-25 - -# common commands -commands: - resolve-dependencies: - description: 'Download and prepare all dependencies' - steps: - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Check if cache was restored' - command: | - if [ -d ~/.m2/repository/io/github/openfeign/querydsl ]; then - echo "Cache hit detected, skipping resolve job." - circleci step halt - else - echo "No cache hit, proceeding with resolve." - fi - - run: - name: 'Resolving Dependencies' - command: | - ./mvnw -ntp -B dependency:resolve-plugins go-offline:resolve-dependencies -DskipTests=true - - save-test-results: - steps: - - run: - name: Save package results - command: | - mkdir -p ~/test-results/junit/ - find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \; - when: always - - store_test_results: - path: ~/test-results - - configure-gpg: - steps: - - run: - name: 'Configure GPG keys' - command: | - echo -e "$GPG_KEY" | base64 -d | gpg --batch --yes --import - -# our job defaults -defaults: &defaults - environment: - # Customize the JVM maximum heap limit - MAVEN_OPTS: -Xmx3200m - JAVA_HOME: /usr/lib/jvm/java-25-openjdk-amd64 - -# branch filters -master-only: &master-only - branches: - only: - - master - - /querydsl-.*/ - -tags-only: &tags-only - branches: - ignore: /.*/ - tags: - only: /.*/ - -all-branches: &all-branches - branches: - ignore: - - master - - /querydsl-.*/ - tags: - ignore: /.*/ - -version: 2.1 - -jobs: - resolve: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - steps: - - checkout - - resolve-dependencies - - save_cache: - paths: - - ~/.m2/repository - key: m2repo-{{ checksum "pom.xml" }} - test: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - no_output_timeout: 60m - command: | - ./mvnw -ntp -B verify -Pno-databases - - save-test-results - - windows: - machine: - image: windows-server-2019-vs2019:current # Windows machine image - resource_class: windows.medium - environment: - MAVEN_OPTS: -Xmx3200m - - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Install JDK 25' - command: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest -Uri "https://api.adoptium.net/v3/binary/latest/25/ga/windows/x64/jdk/hotspot/normal/eclipse?project=jdk" -OutFile "$env:TEMP\jdk.zip" - Expand-Archive -Path "$env:TEMP\jdk.zip" -DestinationPath "C:\jdk25" - $jdkDir = Get-ChildItem "C:\jdk25" -Directory | Select-Object -First 1 - [Environment]::SetEnvironmentVariable("JAVA_HOME", $jdkDir.FullName, "Machine") - Write-Host "JAVA_HOME set to $($jdkDir.FullName)" - & "$($jdkDir.FullName)\bin\java" -version - shell: powershell.exe - - run: - name: 'Test' - command: | - export JAVA_HOME="$(ls -d /c/jdk25/jdk-* | head -1)" - export PATH="$JAVA_HOME/bin:$PATH" - java -version - ./mvnw -ntp -B verify -Pno-databases -Dtoolchain.skip=true - shell: bash.exe - - buildExamples: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Prepare environment' - command: | - ./mvnw -ntp -B install -Pquickbuild -pl :querydsl-sql-spring,:querydsl-jpa-spring,:querydsl-kotlin-codegen,:querydsl-mongodb,:querydsl-r2dbc,:querydsl-sql-json -am - - run: - name: 'Build and test examples' - command: | - ./mvnw -ntp -B install -Pexamples -rf :querydsl-examples - - save-test-results - buildQuarkusExample: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: cimg/base:2022.06 - steps: - - checkout - - setup_remote_docker: - docker_layer_caching: true - - run: - name: 'Test' - command: | - cp querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile . - docker build --progress=plain . - buildKotlinKspExample: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - steps: - - checkout - - run: - name: 'Prepare environment' - command: | - ./mvnw -N org.codehaus.mojo:properties-maven-plugin:1.2.1:write-project-properties -Dproperties.outputFile=querydsl-examples/querydsl-example-ksp-codegen/gradle.properties - ./mvnw -ntp -B install -Pquickbuild -pl :querydsl-ksp-codegen,:querydsl-jpa -am - - run: - name: 'Build and test examples' - environment: - JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64 - command: | - cd querydsl-examples/querydsl-example-ksp-codegen - ./gradlew --no-daemon --console=plain --info --stacktrace test - - run: - name: 'Save test results' - command: | - mkdir -p ~/test-results/junit/ - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/junit/ \; - when: always - - store_test_results: - path: ~/test-results - testMySQL: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - - image: mysql:5.6.38 - environment: - - MYSQL_ROOT_PASSWORD=querydsl - - MYSQL_USER=querydsl - - MYSQL_PASSWORD=querydsl - - MYSQL_DATABASE=querydsl - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.MySQL - - save-test-results - testPostgreSQL: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - - image: postgis/postgis:16-3.4-alpine - environment: - - POSTGRES_USER=querydsl - - POSTGRES_PASSWORD=querydsl - - POSTGRES_DB=querydsl - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.PostgreSQL - - save-test-results - testCUBRID: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - - image: cubrid/cubrid:11.3 - environment: - - CUBRID_DB=demodb - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.CUBRID - - save-test-results - testOracle: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - - image: gvenzl/oracle-xe:slim-faststart - environment: - - ORACLE_PASSWORD=querydsl - - APP_USER=querydsl - - APP_USER_PASSWORD=querydsl - - TZ=UTC - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.Oracle - - save-test-results - testMongo: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - - image: mongo:8.0.9 - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.MongoDB - - save-test-results - testFirebird: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - - image: jacobalberty/firebird:v4 - environment: - - ISC_PASSWORD=masterkey - - FIREBIRD_DATABASE=querydsl.fdb - - FIREBIRD_USER=querydsl - - FIREBIRD_PASSWORD=querydsl - - TZ=UTC - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.Firebird - - save-test-results - testEmbedded: - <<: *defaults - working_directory: ~/querydsl - docker: - - image: velo/toolchains-4-ci-builds:with-25 - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: 'Test' - command: | - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.EmbeddedDatabase,com.querydsl.core.testutil.Turso - - save-test-results - testDB2: - # Use the machine executor so we have full VM capabilities (e.g. docker running as admin) - machine: true - working_directory: ~/querydsl - environment: - DB2INST1_PASSWORD: a3sd!fDj - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - run: - name: "Start DB2 container" - command: | - docker run -d --privileged --name db2 \ - -p 50000:50000 \ - -e DB2INST1_PASSWORD=a3sd!fDj \ - -e DB2INSTANCE=db2inst1 \ - -e DBNAME=sample \ - -e LICENSE=accept \ - -e ARCHIVE_LOGS=false \ - -e AUTOCONFIG=false \ - ibmcom/db2:11.5.0.0 - - echo "Waiting for DB2 to initialize..." - for i in {1..60}; do - if docker logs db2 2>&1 | grep -q "All databases are now active"; then - echo "DB2 appears to be up" - break - fi - echo "Waiting ($i/60)..." - sleep 10 - done - docker ps - - run: - name: "Run DB2 tests" - command: | - docker run --rm \ - --network host \ - -v $(pwd):/code \ - -v ~/.m2/repository:/root/.m2/repository \ - -w /code \ - -e MAVEN_OPTS=-Xmx3200m \ - -e JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64 \ - velo/toolchains-4-ci-builds:with-25 \ - ./mvnw -ntp -B install -Pci -Dgroups=com.querydsl.core.testutil.DB2 - - run: - name: "Stop and remove DB2 container" - command: | - docker stop db2 && docker rm db2 - when: always - - save-test-results - - deploySnapshot: - executor: - name: java - <<: *defaults - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - configure-gpg - - run: - name: 'Deploy Core Modules Sonatype' - no_output_timeout: 4h - command: | - ./mvnw -ntp -B -nsu -s .circleci/settings.xml -DskipTests=true deploy -Prelease -pl '!:querydsl-apt-test' - - deployRelease: - executor: - name: java - <<: *defaults - steps: - - checkout - - restore_cache: - keys: - - m2repo-{{ checksum "pom.xml" }} - - configure-gpg - - run: - name: 'Deploy Core Modules Sonatype' - no_output_timeout: 4h - command: | - ./mvnw -ntp -B -nsu -s .circleci/settings.xml -DskipTests=true deploy -Prelease,staging -pl '!:querydsl-apt-test' - -workflows: - version: 2 - build: - jobs: - - resolve: - name: 'Resolve dependencies' - filters: - <<: *all-branches - - test: - name: 'Compile and package (no external databases)' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - windows: - name: 'Compile and package on Windows (no external databases)' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - buildExamples: - name: 'Compile and package Examples' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - buildQuarkusExample: - name: 'Compile and test Quarkus Native Example' - filters: - <<: *all-branches - - buildKotlinKspExample: - name: 'Compile and test Kotlin KSP Example' - filters: - <<: *all-branches - - testMySQL: - name: 'Test MySQL' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testPostgreSQL: - name: 'Test PostgreSQL' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testCUBRID: - name: 'Test CUBRID' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testOracle: - name: 'Test Oracle' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testMongo: - name: 'Test MongoDB' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testFirebird: - name: 'Test Firebird' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testEmbedded: - name: 'Test Embedded databases' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - testDB2: - name: 'Test DB2' - requires: - - 'Resolve dependencies' - filters: - <<: *all-branches - - snapshot: - jobs: - - resolve: - name: 'Resolve dependencies' - filters: - <<: *master-only - - test: - name: 'snapshot' - requires: - - 'Resolve dependencies' - filters: - <<: *master-only - - deploySnapshot: - name: 'deploy snapshot' - requires: - - 'snapshot' - context: central - filters: - <<: *master-only - - release: - jobs: - - deployRelease: - name: 'release to maven central' - context: central - filters: - <<: *tags-only diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml new file mode 100644 index 0000000000..42acb3179f --- /dev/null +++ b/.github/actions/setup-build/action.yml @@ -0,0 +1,47 @@ +name: "Setup build environment" +description: "Install JDKs (17/21/25), generate Maven toolchains.xml, and restore the Maven dependency cache" + +runs: + using: "composite" + steps: + - name: Set up JDKs 17, 21 and 25 + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: | + 17 + 21 + 25 + + - name: Generate Maven toolchains.xml + shell: bash + run: | + mkdir -p ~/.m2 + cat > ~/.m2/toolchains.xml < + + + jdk + 17 + ${JAVA_HOME_17_X64} + + + jdk + 21 + ${JAVA_HOME_21_X64} + + + jdk + 25 + ${JAVA_HOME_25_X64} + + + EOF + + - name: Cache Maven dependencies + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: maven-deps-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven-deps- diff --git a/.circleci/settings.xml b/.github/settings.xml similarity index 54% rename from .circleci/settings.xml rename to .github/settings.xml index f0f6ad85a5..6025416797 100644 --- a/.circleci/settings.xml +++ b/.github/settings.xml @@ -1,18 +1,3 @@ - + ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl ${{ env.SQL_MODULES }} + -Dgroups=com.querydsl.core.testutil.H2,com.querydsl.core.testutil.HSQLDB,com.querydsl.core.testutil.Derby,com.querydsl.core.testutil.SQLite,com.querydsl.core.testutil.Turso + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (embedded)" + + mysql: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + services: + mysql: + image: mysql:5.6.38 + env: + MYSQL_ROOT_PASSWORD: querydsl + MYSQL_USER: querydsl + MYSQL_PASSWORD: querydsl + MYSQL_DATABASE: querydsl + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping -h localhost -uroot -pquerydsl" + --health-interval=10s --health-timeout=5s --health-retries=20 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Test MySQL + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl ${{ env.SQL_MODULES }} -Dgroups=com.querydsl.core.testutil.MySQL + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (MySQL)" + + postgresql: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + services: + postgres: + image: postgis/postgis:16-3.4-alpine + env: + POSTGRES_USER: querydsl + POSTGRES_PASSWORD: querydsl + POSTGRES_DB: querydsl + ports: + - 5432:5432 + options: >- + --health-cmd="pg_isready -U querydsl" --health-interval=10s + --health-timeout=5s --health-retries=20 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Test PostgreSQL + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl ${{ env.SQL_MODULES }} -Dgroups=com.querydsl.core.testutil.PostgreSQL + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (PostgreSQL)" + + oracle: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 40 + services: + oracle: + image: gvenzl/oracle-xe:slim-faststart + env: + ORACLE_PASSWORD: querydsl + APP_USER: querydsl + APP_USER_PASSWORD: querydsl + TZ: UTC + ports: + - 1521:1521 + options: >- + --health-cmd="healthcheck.sh" --health-interval=10s + --health-timeout=5s --health-retries=30 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Test Oracle + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl ${{ env.ORACLE_MODULES }} -Dgroups=com.querydsl.core.testutil.Oracle + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (Oracle)" + + cubrid: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + services: + cubrid: + image: cubrid/cubrid:11.3 + env: + CUBRID_DB: demodb + ports: + - 30000:30000 + - 33000:33000 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Wait for CUBRID + run: | + for i in $(seq 1 30); do + if (echo > /dev/tcp/localhost/30000) >/dev/null 2>&1; then + echo "CUBRID broker is accepting connections"; break + fi + echo "Waiting for CUBRID ($i/30)..."; sleep 10 + done + - name: Test CUBRID + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl :querydsl-sql -Dgroups=com.querydsl.core.testutil.CUBRID + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (CUBRID)" + + firebird: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + services: + firebird: + image: jacobalberty/firebird:v4 + env: + ISC_PASSWORD: masterkey + FIREBIRD_DATABASE: querydsl.fdb + FIREBIRD_USER: querydsl + FIREBIRD_PASSWORD: querydsl + TZ: UTC + ports: + - 3050:3050 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Wait for Firebird + run: | + for i in $(seq 1 30); do + if (echo > /dev/tcp/localhost/3050) >/dev/null 2>&1; then + echo "Firebird is accepting connections"; break + fi + echo "Waiting for Firebird ($i/30)..."; sleep 5 + done + - name: Test Firebird + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl :querydsl-sql -Dgroups=com.querydsl.core.testutil.Firebird + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (Firebird)" + + mongodb: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + services: + mongo: + image: mongo:8.0.9 + ports: + - 27017:27017 + options: >- + --health-cmd="mongosh --eval 'db.runCommand({ ping: 1 })'" + --health-interval=10s --health-timeout=5s --health-retries=20 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Test MongoDB + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl :querydsl-mongodb -Dgroups=com.querydsl.core.testutil.MongoDB + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (MongoDB)" + + db2: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 40 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Start DB2 container + run: | + docker run -d --privileged --name db2 \ + -p 50000:50000 \ + -e DB2INST1_PASSWORD=a3sd!fDj \ + -e DB2INSTANCE=db2inst1 \ + -e DBNAME=sample \ + -e LICENSE=accept \ + -e ARCHIVE_LOGS=false \ + -e AUTOCONFIG=false \ + ibmcom/db2:11.5.0.0 + echo "Waiting for DB2 to initialize..." + for i in $(seq 1 60); do + if docker logs db2 2>&1 | grep -q "All databases are now active"; then + echo "DB2 appears to be up"; break + fi + echo "Waiting ($i/60)..."; sleep 10 + done + - name: Test DB2 + run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl :querydsl-sql -Dgroups=com.querydsl.core.testutil.DB2 + - name: Stop DB2 container + if: always() + run: docker stop db2 && docker rm db2 + - name: Publish test report + uses: mikepenz/action-junit-report@v5 + if: always() + with: + report_paths: "**/target/surefire-reports/TEST-*.xml" + check_name: "Test report (DB2)" + + examples: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Prepare example prerequisites + run: > + ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pquickbuild + -pl :querydsl-sql-spring,:querydsl-jpa-spring,:querydsl-kotlin-codegen,:querydsl-mongodb,:querydsl-r2dbc,:querydsl-sql-json -am + - name: Build and test examples + run: ./mvnw -ntp -B install -Pexamples -rf :querydsl-examples + + examples-quarkus: + if: ${{ !github.event.pull_request.draft }} + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - name: Build Quarkus native example image + run: | + cp querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile . + docker build --progress=plain . + + examples-ksp: + if: ${{ !github.event.pull_request.draft }} + needs: build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - name: Setup build environment + uses: ./.github/actions/setup-build + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Prepare KSP example prerequisites + run: | + ./mvnw -N org.codehaus.mojo:properties-maven-plugin:1.2.1:write-project-properties -Dproperties.outputFile=querydsl-examples/querydsl-example-ksp-codegen/gradle.properties + ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pquickbuild -pl :querydsl-ksp-codegen,:querydsl-jpa -am + - name: Build and test KSP example + run: | + export JAVA_HOME="$JAVA_HOME_21_X64" + cd querydsl-examples/querydsl-example-ksp-codegen + ./gradlew --no-daemon --console=plain --info --stacktrace test + + # Single required status check that aggregates every test job. + ci: + if: always() && !github.event.pull_request.draft + runs-on: ubuntu-latest + needs: + - build + - windows + - embedded + - mysql + - postgresql + - oracle + - cubrid + - firebird + - mongodb + - db2 + - examples + - examples-quarkus + - examples-ksp + steps: + - name: Check upstream job results + run: | + echo "Aggregating upstream job results..." + FAILED="" + ALL_SKIPPED=true + NEEDS_JSON='${{ toJSON(needs) }}' + for job in $(echo "$NEEDS_JSON" | jq -r 'keys[]'); do + result=$(echo "$NEEDS_JSON" | jq -r ".[\"$job\"].result") + echo " $job: $result" + if [[ "$result" == "failure" || "$result" == "cancelled" ]]; then + FAILED="$FAILED $job" + fi + if [[ "$result" != "skipped" ]]; then + ALL_SKIPPED=false + fi + done + if [[ "$ALL_SKIPPED" == "true" ]]; then + echo "All upstream jobs were skipped - refusing to report success." + exit 1 + fi + if [[ -n "$FAILED" ]]; then + echo "Failed jobs:$FAILED" + exit 1 + fi + echo "All upstream jobs passed." diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000..4f8b88c401 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,66 @@ +name: Deploy + +on: + push: + branches: ["master", "querydsl-*"] + tags: ["*"] + +concurrency: + group: deploy-${{ github.ref }} + cancel-in-progress: false + +env: + MAVEN_OPTS: -Xmx3200m + +jobs: + # Deploy SNAPSHOT artifacts to Maven Central on every push to master / querydsl-* branches. + snapshot: + if: startsWith(github.ref, 'refs/heads/') + runs-on: ubuntu-latest + timeout-minutes: 60 + environment: central + steps: + - uses: actions/checkout@v4 + + - name: Setup build environment + uses: ./.github/actions/setup-build + + - name: Import GPG key + run: echo -e "$GPG_KEY" | base64 -d | gpg --batch --yes --import + env: + GPG_KEY: ${{ secrets.GPG_KEY }} + + - name: Deploy snapshot to Maven Central + env: + CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: > + ./mvnw -ntp -B -nsu -s .github/settings.xml -DskipTests=true + deploy -Prelease -pl '!:querydsl-apt-test' + + # Deploy a release to Maven Central (staging) when a tag is pushed. + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + timeout-minutes: 60 + environment: central + steps: + - uses: actions/checkout@v4 + + - name: Setup build environment + uses: ./.github/actions/setup-build + + - name: Import GPG key + run: echo -e "$GPG_KEY" | base64 -d | gpg --batch --yes --import + env: + GPG_KEY: ${{ secrets.GPG_KEY }} + + - name: Deploy release to Maven Central + env: + CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: > + ./mvnw -ntp -B -nsu -s .github/settings.xml -DskipTests=true + deploy -Prelease,staging -pl '!:querydsl-apt-test' From 3a5512f576b0eea07d05382e033448b1f531d8ac Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Sun, 21 Jun 2026 12:27:21 -0300 Subject: [PATCH 2/3] ci: wait for CUBRID demodb readiness so its tests actually run Signed-off-by: Marvin Froeder --- .github/workflows/build-and-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8b30301fe4..94eb96b884 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -218,13 +218,13 @@ jobs: with: path: ~/.m2/repository/io/github/openfeign/querydsl key: build-artifacts-${{ github.sha }} - - name: Wait for CUBRID + - name: Wait for CUBRID demodb to be ready run: | for i in $(seq 1 30); do - if (echo > /dev/tcp/localhost/30000) >/dev/null 2>&1; then - echo "CUBRID broker is accepting connections"; break + if docker logs "${{ job.services.cubrid.id }}" 2>&1 | grep -q "cubrid server start: demodb"; then + echo "CUBRID demodb server has started"; sleep 5; break fi - echo "Waiting for CUBRID ($i/30)..."; sleep 10 + echo "Waiting for CUBRID demodb ($i/30)..."; sleep 5 done - name: Test CUBRID run: ./mvnw -ntp -B install -Deasyjacoco.skip=true -Pci -pl :querydsl-sql -Dgroups=com.querydsl.core.testutil.CUBRID From 757e1cb79adf3467cecb62e5e4c32394fec8f9db Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Sun, 21 Jun 2026 17:18:58 -0300 Subject: [PATCH 3/3] ci: rename build job to compile and aggregation gate to build; quarkus example reuses compiled artifacts Signed-off-by: Marvin Froeder --- .github/workflows/build-and-test.yml | 46 ++++++++++++------- .github/workflows/dependency-submission.yml | 2 +- .../querydsl-example-jpa-quarkus/Dockerfile | 15 +++++- 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 94eb96b884..28f14b3e49 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -21,9 +21,9 @@ env: ORACLE_MODULES: ":querydsl-jpa,:querydsl-sql,:querydsl-sql-codegen" jobs: - # Build all core jars once (and run the database-independent unit tests), then publish + # Compile all core jars once (and run the database-independent unit tests), then publish # the built artifacts as a per-commit cache that every downstream test job restores. - build: + compile: if: ${{ !github.event.pull_request.draft }} runs-on: ubuntu-latest timeout-minutes: 30 @@ -66,7 +66,7 @@ jobs: embedded: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -91,7 +91,7 @@ jobs: mysql: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 services: @@ -127,7 +127,7 @@ jobs: postgresql: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 services: @@ -162,7 +162,7 @@ jobs: oracle: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 40 services: @@ -198,7 +198,7 @@ jobs: cubrid: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 services: @@ -237,7 +237,7 @@ jobs: firebird: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 services: @@ -279,7 +279,7 @@ jobs: mongodb: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 services: @@ -310,7 +310,7 @@ jobs: db2: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 40 steps: @@ -354,7 +354,7 @@ jobs: examples: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -375,18 +375,30 @@ jobs: examples-quarkus: if: ${{ !github.event.pull_request.draft }} + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - name: Build Quarkus native example image + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository/io/github/openfeign/querydsl + key: build-artifacts-${{ github.sha }} + - name: Stage Querydsl artifacts for the image build run: | - cp querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile . - docker build --progress=plain . + mkdir -p /tmp/m2inject/io/github/openfeign + cp -r ~/.m2/repository/io/github/openfeign/querydsl /tmp/m2inject/io/github/openfeign/ + - name: Build Quarkus native example image (reusing compiled artifacts) + run: | + DOCKER_BUILDKIT=1 docker build --progress=plain \ + -f querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile \ + --build-context m2=/tmp/m2inject \ + --build-arg REUSE_M2=true . examples-ksp: if: ${{ !github.event.pull_request.draft }} - needs: build + needs: compile runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -409,11 +421,11 @@ jobs: ./gradlew --no-daemon --console=plain --info --stacktrace test # Single required status check that aggregates every test job. - ci: + build: if: always() && !github.event.pull_request.draft runs-on: ubuntu-latest needs: - - build + - compile - windows - embedded - mysql diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml index 4d963ea23a..4644ccb45a 100644 --- a/.github/workflows/dependency-submission.yml +++ b/.github/workflows/dependency-submission.yml @@ -20,7 +20,7 @@ permissions: contents: write jobs: - build: + dependency-submission: # Dependabot and fork PRs run with a read-only GITHUB_TOKEN, so the # snapshot submission would 403 and fail the check — the likely reason the # original workflow was flaky. Skip those; pushes to master are what keep diff --git a/querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile b/querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile index 6831392879..96ab61d354 100644 --- a/querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile +++ b/querydsl-examples/querydsl-example-jpa-quarkus/Dockerfile @@ -1,7 +1,18 @@ +# Optional pre-built Querydsl artifacts, injected by CI's "compile" job via +# --build-context m2= --build-arg REUSE_M2=true +# so the image build does not have to recompile Querydsl from source. Empty by default, +# so a plain `docker build` still works standalone (it rebuilds Querydsl itself). +FROM scratch AS m2 + FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-25 AS build +ARG REUSE_M2=false COPY --chown=quarkus:quarkus . /code/ +COPY --from=m2 --chown=quarkus:quarkus . /home/quarkus/.m2/repository/ USER quarkus WORKDIR /code -RUN ./mvnw -ntp -B install -Pquickbuild -pl :querydsl-jpa -am -Dtoolchain.skip -Dgcf.skip -RUN ./mvnw verify -Dnative -Pexamples -pl :querydsl-example-jpa-quarkus -Dtoolchain.skip -Dgcf.skip +# Build Querydsl from source only when prebuilt artifacts were not injected. +RUN if [ "$REUSE_M2" != "true" ]; then \ + ./mvnw -ntp -B install -Pquickbuild -pl :querydsl-jpa -am -Dtoolchain.skip -Dgcf.skip ; \ + fi +RUN ./mvnw -ntp -B verify -Dnative -Pexamples -pl :querydsl-example-jpa-quarkus -Dtoolchain.skip -Dgcf.skip