Skip to content

Commit 37405a4

Browse files
committed
Generate docs with JNI
1 parent 91856a3 commit 37405a4

File tree

3 files changed

+26
-67
lines changed

3 files changed

+26
-67
lines changed

.github/workflows/rc.yml

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -76,49 +76,6 @@ jobs:
7676
name: release-source
7777
path: |
7878
apache-arrow-java-*
79-
docs:
80-
name: Docs
81-
runs-on: ubuntu-latest
82-
timeout-minutes: 30
83-
needs:
84-
- source
85-
env:
86-
DOCKER_VOLUME_PREFIX: .docker/
87-
permissions:
88-
contents: read
89-
packages: write
90-
steps:
91-
- name: Download source archive
92-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
93-
with:
94-
name: release-source
95-
- name: Extract source archive
96-
run: |
97-
tar -xf apache-arrow-java-*.tar.gz --strip-components=1
98-
- uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
99-
with:
100-
registry: ghcr.io
101-
username: ${{ github.actor }}
102-
password: ${{ secrets.GITHUB_TOKEN }}
103-
- name: Cache
104-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
105-
with:
106-
path: .docker
107-
key: docs-${{ hashFiles('compose.yaml', '**/pom.xml', '**/*.java') }}
108-
restore-keys: docs-
109-
- name: Build
110-
run: |
111-
docker compose run \
112-
--volume "${PWD}/build/:/build/" \
113-
docs
114-
- name: Compress into single artifact to keep directory structure
115-
run: |
116-
tar -cvzf docs.tar.gz -C build/java docs
117-
- name: Upload artifacts
118-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
119-
with:
120-
name: release-docs-${{ matrix.platform.arch }}
121-
path: docs.tar.gz
12279
jni-linux:
12380
name: JNI ${{ matrix.platform.runs_on }} ${{ matrix.platform.arch }}
12481
runs-on: ${{ matrix.platform.runs_on }}
@@ -143,6 +100,14 @@ jobs:
143100
contents: read
144101
packages: write
145102
steps:
103+
- name: Prepare
104+
run: |
105+
if [ ${{ matrix.platform.arch }} = "x86_64" ]; then
106+
ARROW_JAVA_BUILD_DOCS=ON
107+
else
108+
ARROW_JAVA_BUILD_DOCS=ON
109+
fi
110+
echo "ARROW_JAVA_BUILD_DOCS=${ARROW_JAVA_BUILD_DOCS}" >> ${GIHUTB_ENV}
146111
- name: Download source archive
147112
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
148113
with:
@@ -176,7 +141,10 @@ jobs:
176141
restore-keys: jni-linux-${{ matrix.platform.arch }}-
177142
- name: Build
178143
run: |
179-
docker compose run vcpkg-jni
144+
docker compose run \
145+
--env ARROW_JAVA_BUILD_DOCS=${ARROW_JAVA_BUILD_DOCS} \
146+
--volume "${PWD}/build/:/build/" \
147+
vcpkg-jni
180148
- name: Push Docker image
181149
if: success() && github.event_name == 'push' && github.repository == 'apache/arrow-java' && github.ref_name == 'main'
182150
run: |
@@ -188,6 +156,15 @@ jobs:
188156
with:
189157
name: jni-linux-${{ matrix.platform.arch }}
190158
path: jni-linux-${{ matrix.platform.arch }}.tar.gz
159+
- name: Compress docs
160+
if: env.ARROW_JAVA_BUILD_DOCS == 'docs'
161+
run: tar -cvzf docs.tar.gz -C build/java docs
162+
- name: Upload artifacts
163+
if: env.ARROW_JAVA_BUILD_DOCS == 'docs'
164+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
165+
with:
166+
name: release-docs-${{ matrix.platform.arch }}
167+
path: docs.tar.gz
191168
jni-macos:
192169
name: JNI ${{ matrix.platform.runs_on }} ${{ matrix.platform.arch }}
193170
runs-on: ${{ matrix.platform.runs_on }}

ci/scripts/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ if [[ "${ARROW_JAVA_TEST:-ON}" != "ON" ]]; then
2323
exit
2424
fi
2525

26-
source_dir=${1}
26+
source_dir="$(cd "${1}" && pwd)"
2727
build_dir=${2}/java
2828
java_jni_dist_dir=${3}
2929

30+
if [ -d "${java_jni_dist_dir}" ]; then
31+
java_jni_dist_dir="$(cd "${java_jni_dist_dir}" && pwd)"
32+
fi
33+
3034
mvn="mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
3135
# Use `2 * ncores` threads
3236
mvn="${mvn} -T 2C"

compose.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,6 @@ services:
5050
/arrow-java/ci/scripts/build.sh /arrow-java /build /jni &&
5151
/arrow-java/ci/scripts/test.sh /arrow-java /build /jni"
5252

53-
docs:
54-
# Build docs.
55-
#
56-
# Usage:
57-
# docker compose build docs
58-
# docker compose run docs
59-
# Parameters:
60-
# MAVEN: 3.9.9
61-
# JDK: 11, 17, 21
62-
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
63-
volumes:
64-
- .:/arrow-java:delegated
65-
- ${DOCKER_VOLUME_PREFIX}maven-cache:/root/.m2:delegated
66-
environment:
67-
ARROW_JAVA_BUILD_DOCS: "ON"
68-
ARROW_JAVA_SKIP_GIT_PLUGIN: "ON"
69-
command:
70-
- /arrow-java/ci/scripts/build.sh
71-
- /arrow-java
72-
- /build
73-
- /jni
74-
7553
conda-jni-cdata:
7654
# Builds and tests just the C Data Interface JNI library and JARs.
7755
# (No dependencies on arrow-cpp.)

0 commit comments

Comments
 (0)