|
46 | 46 | runs-on: ubuntu-latest |
47 | 47 | strategy: |
48 | 48 | matrix: |
49 | | - java: ['11', '17', '21', '22'] |
| 49 | + java: ['11', '17', '21', '24'] |
50 | 50 | steps: |
51 | 51 | - uses: actions/checkout@v4 |
52 | 52 | with: |
@@ -102,3 +102,118 @@ jobs: |
102 | 102 | HERE |
103 | 103 | # Our linters are compile-time, no point re-running tests |
104 | 104 | mvn -P errorprone install -DskipTests |
| 105 | +
|
| 106 | + java-jni-artifacts: |
| 107 | + name: "JNI Libraries/${{ matrix.os }} ${{ matrix.arch }}" |
| 108 | + runs-on: ${{ matrix.runner }} |
| 109 | + strategy: |
| 110 | + matrix: |
| 111 | + include: |
| 112 | + - { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest } |
| 113 | + - { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner: macos-latest } |
| 114 | + env: |
| 115 | + VCPKG_ROOT: "${{ github.workspace }}/vcpkg" |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v4 |
| 118 | + with: |
| 119 | + fetch-depth: 0 |
| 120 | + persist-credentials: false |
| 121 | + - uses: actions/setup-java@v4 |
| 122 | + with: |
| 123 | + cache: "maven" |
| 124 | + distribution: "temurin" |
| 125 | + java-version: 11 |
| 126 | + - name: Retrieve Go, VCPKG version from .env |
| 127 | + run: | |
| 128 | + (. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV |
| 129 | + (. .env && echo "VCPKG_VERSION=${VCPKG}") >> $GITHUB_ENV |
| 130 | + - name: Install vcpkg |
| 131 | + run: | |
| 132 | + ./ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION |
| 133 | + - uses: actions/setup-go@v5 |
| 134 | + with: |
| 135 | + go-version: "${{ env.GO_VERSION }}" |
| 136 | + check-latest: true |
| 137 | + cache: true |
| 138 | + cache-dependency-path: adbc/go/adbc/go.sum |
| 139 | + - name: Install Homebrew dependencies |
| 140 | + if: matrix.os == 'macOS' |
| 141 | + run: brew install autoconf bash pkg-config ninja |
| 142 | + - name: Build artifacts |
| 143 | + if: matrix.os != 'macOS' |
| 144 | + run: | |
| 145 | + docker compose run python-wheel-manylinux-build |
| 146 | + - name: Build artifacts (macOS) |
| 147 | + if: matrix.os == 'macOS' |
| 148 | + run: | |
| 149 | + export ADBC_BUILD_STATIC=ON |
| 150 | + export ADBC_BUILD_TESTS=OFF |
| 151 | + export ADBC_USE_ASAN=OFF |
| 152 | + export ADBC_USE_UBSAN=OFF |
| 153 | + ./ci/scripts/python_wheel_unix_build.sh ${{ matrix.arch }} $(pwd) $(pwd)/build |
| 154 | + - name: Build JNI artifacts |
| 155 | + run: | |
| 156 | + export ADBC_BUILD_STATIC=ON |
| 157 | + export ADBC_BUILD_TESTS=OFF |
| 158 | + export ADBC_USE_ASAN=OFF |
| 159 | + export ADBC_USE_UBSAN=OFF |
| 160 | + ./ci/scripts/java_build.sh $(pwd) |
| 161 | + ./ci/scripts/java_jni_build.sh $(pwd) $(pwd)/build_jni $(pwd)/build/${{ matrix.vcpkg_arch }} |
| 162 | + - name: Assemble artifacts |
| 163 | + run: | |
| 164 | + mkdir artifacts |
| 165 | + cp -r java/driver/jni/src/main/resources/ artifacts/jni |
| 166 | + cp -r build/${{ matrix.vcpkg_arch }}/lib artifacts/driver |
| 167 | + ls -laR artifacts |
| 168 | + mv artifacts artifacts-${{ matrix.os }}-${{ matrix.arch }} |
| 169 | + tar czf artifacts-${{ matrix.os }}-${{ matrix.arch }}.tgz artifacts-${{ matrix.os }}-${{ matrix.arch }} |
| 170 | + - uses: actions/upload-artifact@v4 |
| 171 | + with: |
| 172 | + name: jni-artifacts-${{ matrix.os }}-${{ matrix.arch }} |
| 173 | + retention-days: 7 |
| 174 | + path: | |
| 175 | + artifacts-${{ matrix.os }}-${{ matrix.arch }}.tgz |
| 176 | +
|
| 177 | + java-jni: |
| 178 | + name: "Java ${{ matrix.java }} JNI/${{ matrix.os }} ${{ matrix.arch }}" |
| 179 | + runs-on: ${{ matrix.runner }} |
| 180 | + needs: |
| 181 | + - java-jni-artifacts |
| 182 | + strategy: |
| 183 | + matrix: |
| 184 | + java: ['11', '24'] |
| 185 | + include: |
| 186 | + - { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest } |
| 187 | + - { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner: macos-latest } |
| 188 | + steps: |
| 189 | + - uses: actions/checkout@v4 |
| 190 | + with: |
| 191 | + fetch-depth: 0 |
| 192 | + persist-credentials: false |
| 193 | + submodules: recursive |
| 194 | + - uses: actions/download-artifact@v4 |
| 195 | + with: |
| 196 | + path: artifacts |
| 197 | + pattern: jni-artifacts-* |
| 198 | + merge-multiple: true |
| 199 | + - uses: actions/setup-java@v4 |
| 200 | + with: |
| 201 | + cache: "maven" |
| 202 | + distribution: "temurin" |
| 203 | + java-version: 11 |
| 204 | + - name: Build/Test |
| 205 | + run: | |
| 206 | + set -x |
| 207 | + pushd artifacts |
| 208 | + for archive in artifacts*.tgz; do |
| 209 | + tar xvf $archive |
| 210 | + done |
| 211 | + popd |
| 212 | + cp -r artifacts/*/jni/adbc_driver_jni java/driver/jni/src/main/resources |
| 213 | + for driver in artifacts/*/driver; do |
| 214 | + export LD_LIBRARY_PATH=$(pwd)/$driver:${LD_LIBRARY_PATH:-} |
| 215 | + export DYLD_LIBRARY_PATH=$(pwd)/$driver:${DYLD_LIBRARY_PATH:-} |
| 216 | + done |
| 217 | + env BUILD_JNI=ON ./ci/scripts/java_build.sh $(pwd) |
| 218 | + cd java |
| 219 | + mvn -B -Pjni test -pl :adbc-driver-jni |
0 commit comments