diff --git a/.github/composite-actions/linux-tests-host/action.yml b/.github/composite-actions/linux-tests-host/action.yml index eb4cc14e9..6414e0483 100644 --- a/.github/composite-actions/linux-tests-host/action.yml +++ b/.github/composite-actions/linux-tests-host/action.yml @@ -5,10 +5,10 @@ runs: using: "composite" steps: - name: Setup JDK 26 - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: distribution: 'corretto' - java-version: '26' + java-version: '27' - name: Tests Host shell: bash diff --git a/.github/workflows/Java.yml b/.github/workflows/Java.yml index 1bb9b2b26..12ef85c28 100644 --- a/.github/workflows/Java.yml +++ b/.github/workflows/Java.yml @@ -26,25 +26,31 @@ on: required: false default: '' type: 'string' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ (github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/v')) || github.run_id }} + cancel-in-progress: true jobs: format-check: name: Format Check if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'vendoring-')) }} - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-slim' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v7 with: fetch-depth: 0 - run: | python ./scripts/retry.py --timeout 1m -- \ - python -m pip install --user clang_format==11.0.1 + python -m pip install --user --break-system-packages clang_format==11.0.1 + export PATH=~/.local/bin:$PATH + which clang-format + clang-format --version make format-check java-linux-amd64: name: Linux (amd64) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: format-check env: MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 @@ -109,7 +115,7 @@ jobs: java-linux-amd64-tck: name: Linux TCK (amd64) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: java-linux-amd64 env: MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 @@ -171,7 +177,7 @@ jobs: java-linux-amd64-graal: name: Linux Graal (amd64) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: java-linux-amd64 env: MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 @@ -215,7 +221,7 @@ jobs: java-linux-amd64-spark: name: Linux Spark (amd64) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: java-linux-amd64 env: MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 @@ -235,6 +241,7 @@ jobs: MINIO_DATA: ${{ github.workspace }}/sparktest/minio_data MINIO_HOST: 127.0.0.1 MINIO_PORT: 9000 + steps: - uses: actions/checkout@v7 with: @@ -254,6 +261,12 @@ jobs: path: ${{ github.workspace }}/ccache key: ${{ steps.cache_key.outputs.value }} + - name: Setup JDK + uses: actions/setup-java@v6 + with: + distribution: corretto + java-version: '17' + - name: Build if: ${{ inputs.skip_tests != 'true' }} uses: ./.github/composite-actions/linux-build-docker @@ -268,15 +281,20 @@ jobs: cmake .. - name: Setup Postgres - if: ${{ inputs.skip_tests != 'true' }} - uses: ikalnytskyi/action-setup-postgres@v7 - with: - postgres-version: '17' - username: ${{ env.POSTGRES_USERNAME }} - password: ${{ env.POSTGRES_PASSWORD }} - database: ${{ env.POSTGRES_MAINTENANCE_DB }} - port: ${{ env.POSTGRES_PORT }} - ssl: true + run: | + docker run -d \ + --name postgres \ + -p 5432:${{ env.POSTGRES_PORT }} \ + -e POSTGRES_USER=${{ env.POSTGRES_USERNAME }} \ + -e POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }} \ + -e POSTGRES_DB=${{ env.POSTGRES_MAINTENANCE_DB }} \ + ghcr.io/infrastructure-as-code/postgres:18-alpine + python ./scripts/retry.py --retries 0 --timeout 1m -- \ + bash -lc ' + until docker exec postgres pg_isready -U ${{ env.POSTGRES_USERNAME }} -d ${{ env.POSTGRES_MAINTENANCE_DB }}; do + sleep 2 + done + ' - name: Setup Minio if: ${{ inputs.skip_tests != 'true' }} @@ -318,7 +336,7 @@ jobs: java-linux-amd64-asan: name: Linux ASan (amd64) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: java-linux-amd64 env: GEN: ninja @@ -333,8 +351,8 @@ jobs: - name: Dependencies run: | - echo "set man-db/auto-update false" | sudo debconf-communicate - sudo dpkg-reconfigure man-db + echo "set man-db/auto-update false" | sudo debconf-communicate || true + sudo dpkg-reconfigure man-db || true python ./scripts/retry.py --timeout 2m -- \ sudo apt-get update -y -q -o=Dpkg::Use-Pty=0 python ./scripts/retry.py --timeout 2m -- \ @@ -417,7 +435,7 @@ jobs: java-linux-amd64-jepsen: name: Linux Jepsen (amd64) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: java-linux-amd64 env: MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 @@ -453,8 +471,8 @@ jobs: - name: Install Dependencies run: | - echo "set man-db/auto-update false" | sudo debconf-communicate - sudo dpkg-reconfigure man-db + echo "set man-db/auto-update false" | sudo debconf-communicate || true + sudo dpkg-reconfigure man-db || true python ./scripts/retry.py --timeout 1m -- \ sudo apt-get update -y -q -o=Dpkg::Use-Pty=0 python ./scripts/retry.py --timeout 1m -- \ @@ -463,13 +481,11 @@ jobs: graphviz \ leiningen - - name: Setup Default Java - run: | - echo "JAVA_HOME=${JAVA_HOME_21_X64}" >> $GITHUB_ENV - echo "${JAVA_HOME_21_X64}/bin" >> $GITHUB_PATH - sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java - sudo update-alternatives --set javac /usr/lib/jvm/java-21-openjdk-amd64/bin/javac - /usr/bin/java --version + - name: Setup JDK + uses: actions/setup-java@v6 + with: + distribution: corretto + java-version: '21' - name: Check JDK version run: | @@ -522,7 +538,7 @@ jobs: java-linux-aarch64: name: Linux (aarch64) - runs-on: ubuntu-24.04-arm + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-arm64' || 'ubuntu-24.04-arm' }} needs: java-linux-amd64 env: MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_aarch64 @@ -581,7 +597,7 @@ jobs: java-linux-amd64-musl: name: Linux (amd64-musl) - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-x64' || 'ubuntu-latest' }} needs: java-linux-amd64 env: ALPINE_IMAGE: alpine:3.22 @@ -636,7 +652,7 @@ jobs: java-linux-aarch64-musl: name: Linux (aarch64-musl) - runs-on: ubuntu-24.04-arm + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-arm64' || 'ubuntu-24.04-arm' }} needs: java-linux-amd64 env: ALPINE_IMAGE: alpine:3.22 @@ -691,7 +707,7 @@ jobs: java-windows-amd64: name: Windows (amd64) - runs-on: windows-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-windows-x64' || 'windows-latest' }} needs: java-linux-amd64 env: CC: 'ccache cl' @@ -711,6 +727,12 @@ jobs: ccache \ -y --force --no-progress + - name: Setup JDK + uses: actions/setup-java@v6 + with: + distribution: corretto + java-version: '8' + - name: Cache Key id: cache_key shell: bash @@ -728,13 +750,13 @@ jobs: - name: Build shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" mkdir build cd build mkdir release cd release cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release + cmake --build . --config Release --parallel - name: Save Cache uses: actions/cache/save@v6 @@ -745,7 +767,7 @@ jobs: - name: List Symbols shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" dumpbin.exe /imports build\release\libduckdb_java.so_windows_amd64 dumpbin.exe /exports build\release\libduckdb_java.so_windows_amd64 @@ -764,7 +786,7 @@ jobs: java-windows-aarch64: name: Windows (aarch64) - runs-on: windows-11-arm + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-windows-x64' || 'windows-latest' }} needs: java-linux-amd64 env: CC: 'ccache cl' @@ -776,10 +798,6 @@ jobs: fetch-depth: 0 ref: ${{ inputs.git_ref }} - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Dependencies shell: bash run: | @@ -788,6 +806,12 @@ jobs: ccache \ -y --force --no-progress + - name: Setup JDK + uses: actions/setup-java@v6 + with: + distribution: corretto + java-version: '8' + - name: Cache Key id: cache_key shell: bash @@ -805,13 +829,13 @@ jobs: - name: Build shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" mkdir build cd build mkdir release cd release - cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release + cmake ../.. -G Ninja -DCMAKE_BUILD_TYPE=Release -DOVERRIDE_JDBC_OS_ARCH=arm64 + cmake --build . --config Release --parallel - name: Save Cache uses: actions/cache/save@v6 @@ -822,12 +846,12 @@ jobs: - name: List Symbols shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" dumpbin.exe /imports build\release\libduckdb_java.so_windows_arm64 dumpbin.exe /exports build\release\libduckdb_java.so_windows_arm64 - name: Java Tests - if: ${{ inputs.skip_tests != 'true' }} + if: ${{ false && inputs.skip_tests != 'true' }} shell: bash run: | java -version @@ -841,7 +865,7 @@ jobs: java-osx-universal: name: macOS (Universal) - runs-on: macos-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-macos-arm64' || 'macos-latest' }} needs: java-linux-amd64 env: GEN: ninja @@ -853,10 +877,6 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@v5 - with: - python-version: "3.14" - - name: Cache Key id: cache_key run: | @@ -877,6 +897,12 @@ jobs: ccache \ ninja + - name: Setup JDK + uses: actions/setup-java@v6 + with: + distribution: corretto + java-version: '8' + - name: Build shell: bash run: make release @@ -913,7 +939,7 @@ jobs: maven-deploy: if: ${{ github.repository == 'duckdb/duckdb-java' && startsWith(github.ref, 'refs/tags/') }} name: Maven Deploy - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-slim' || 'ubuntu-latest' }} needs: - java-linux-amd64 - java-linux-amd64-tck @@ -994,7 +1020,7 @@ jobs: maven-snapshot-deploy: if: ${{ github.repository == 'duckdb/duckdb-java' && (github.ref == 'refs/heads/v2.0-cyanoptera' || github.ref == 'refs/heads/vendoring-v2.0-cyanoptera') && github.event_name == 'workflow_dispatch' }} name: Maven S3 Deploy - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-slim' || 'ubuntu-latest' }} needs: - java-linux-amd64 - java-linux-amd64-tck @@ -1082,7 +1108,7 @@ jobs: - java-windows-amd64 - java-windows-aarch64 - java-osx-universal - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-slim' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v7 with: diff --git a/.github/workflows/Vendor.yml b/.github/workflows/Vendor.yml index 084aaf48c..9d75da574 100644 --- a/.github/workflows/Vendor.yml +++ b/.github/workflows/Vendor.yml @@ -29,7 +29,7 @@ jobs: vendor: name: "Update Vendored Sources" if: ${{ github.repository == 'duckdb/duckdb-java' }} - runs-on: ubuntu-latest + runs-on: ${{ github.repository_owner == 'duckdb' && 'namespace-profile-linux-slim' || 'ubuntu-latest' }} permissions: actions: write contents: write