Skip to content

Test

Test #24

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
name: Test
on:
push:
branches: [main, 'maintenance-**']
tags: ['**']
pull_request:
workflow_dispatch:
inputs:
skip_integration:
description: 'Skip integration tests for timing comparison'
required: false
default: false
type: boolean
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
env:
DOCKER_VOLUME_PREFIX: ".docker/"
jobs:
build-java:
name: Build Java artifacts
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
steps:
- name: Checkout Arrow
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Build without tests
shell: bash
run: ci/scripts/build.sh . build jni
- name: Pack reusable artifacts
shell: bash
run: |
mkdir -p test-artifacts/m2-repository/org/apache
cp -a "${HOME}/.m2/repository/org/apache/arrow" test-artifacts/m2-repository/org/apache/
tar -czf java-build.tgz build test-artifacts
- name: Upload reusable artifacts
uses: actions/upload-artifact@v5
with:
name: java-build
path: java-build.tgz
retention-days: 1
test-java:
name: ${{ matrix.name }} JDK ${{ matrix.jdk }}
needs: build-java
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: AMD64 Ubuntu
os: ubuntu-latest
jdk: 17
- name: AMD64 Ubuntu
os: ubuntu-latest
jdk: 21
- name: AMD64 Ubuntu
os: ubuntu-latest
jdk: 23
- name: AMD64 macOS 15-intel Java
os: macos-15-intel
jdk: 17
- name: AArch64 macOS latest Java
os: macos-latest
jdk: 17
- name: AMD64 Windows Server 2022 Java
os: windows-latest
jdk: 17
steps:
- name: Checkout Arrow
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Download reusable artifacts
uses: actions/download-artifact@v6
with:
name: java-build
- name: Restore reusable artifacts
shell: bash
run: |
tar -xzf java-build.tgz
mkdir -p "${HOME}/.m2/repository/org/apache"
cp -a test-artifacts/m2-repository/org/apache/arrow "${HOME}/.m2/repository/org/apache/"
- name: Test without compiler lifecycle
shell: bash
run: |
set -o pipefail
pushd build
mvn \
-B \
-T 2C \
-Darrow.test.dataRoot="${GITHUB_WORKSPACE}/testing/data" \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-DfailIfNoTests=false \
surefire:test | tee ../surefire.log
popd
if grep -E "Compiling [0-9]+ source files?" surefire.log; then
echo "Unexpected compilation occurred while running prebuilt tests."
exit 1
fi
if ! grep -q "Tests run:" surefire.log; then
echo "No surefire test summary found; tests may have been skipped."
exit 1
fi
compile-check:
name: AMD64 Ubuntu compile check JDK ${{ matrix.jdk }}
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
jdk: [21, 23]
steps:
- name: Checkout Arrow
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Compile without tests
shell: bash
run: mvn -B -T 2C -DskipTests test-compile
build-cdata:
name: Build C Data artifacts
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
env:
JDK: 17
MAVEN: 3.9.9
steps:
- name: Checkout Arrow
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Cache Docker Volumes
uses: actions/cache@v5
with:
path: .docker
key: cdata-${{ env.JDK }}-${{ env.MAVEN }}-${{ hashFiles('compose.yaml', '**/pom.xml') }}
restore-keys: cdata-${{ env.JDK }}-${{ env.MAVEN }}-
- name: Build C Data without tests
shell: bash
run: |
rm -rf .cdata-artifacts
mkdir -p .cdata-artifacts
docker compose run \
--rm \
-e CI=true \
-e ARROW_JAVA_CDATA=ON \
conda-jni-cdata \
/bin/bash -lc '
set -euo pipefail
/arrow-java/ci/scripts/jni_build.sh \
/arrow-java \
/arrow-java/.cdata-artifacts/jni-build \
/arrow-java/.cdata-artifacts/build \
/arrow-java/.cdata-artifacts/jni-dist
ARROW_JAVA_CDATA=ON \
/arrow-java/ci/scripts/build.sh \
/arrow-java \
/arrow-java/.cdata-artifacts/java-build \
/arrow-java/.cdata-artifacts/jni-dist
mkdir -p /arrow-java/.cdata-artifacts/m2-repository/org/apache
cp -a \
/root/.m2/repository/org/apache/arrow \
/arrow-java/.cdata-artifacts/m2-repository/org/apache/
'
sudo chown -R "$(id -u):$(id -g)" .cdata-artifacts
if [ -d .docker ]; then
sudo chown -R "$(id -u):$(id -g)" .docker
fi
- name: Pack reusable C Data artifacts
shell: bash
run: tar -czf cdata-build.tgz .cdata-artifacts
- name: Upload reusable C Data artifacts
uses: actions/upload-artifact@v5
with:
name: cdata-build
path: cdata-build.tgz
retention-days: 1
test-cdata:
name: AMD64 Conda JNI JDK ${{ matrix.jdk }} Maven ${{ matrix.maven }}
needs: build-cdata
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
jdk: [17, 21, 23]
maven: [3.9.9]
env:
JDK: ${{ matrix.jdk }}
MAVEN: ${{ matrix.maven }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Cache Docker Volumes
uses: actions/cache@v5
with:
path: .docker
key: cdata-test-${{ matrix.jdk }}-${{ matrix.maven }}-${{ hashFiles('compose.yaml', '**/pom.xml') }}
restore-keys: cdata-test-${{ matrix.jdk }}-${{ matrix.maven }}-
- name: Download reusable C Data artifacts
uses: actions/download-artifact@v6
with:
name: cdata-build
- name: Restore reusable C Data artifacts
shell: bash
run: tar -xzf cdata-build.tgz
- name: Test C Data without compiler lifecycle
shell: bash
run: |
docker compose run \
--rm \
-e CI=true \
-e ARROW_JAVA_CDATA=ON \
conda-jni-cdata \
/bin/bash -lc '
set -euo pipefail
mkdir -p /root/.m2/repository/org/apache
cp -a \
/arrow-java/.cdata-artifacts/m2-repository/org/apache/arrow \
/root/.m2/repository/org/apache/
cd /arrow-java/.cdata-artifacts/java-build
mvn \
-B \
-T 2C \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-DfailIfNoTests=false \
-Parrow-c-data \
-pl c \
-Darrow.c.jni.dist.dir=/arrow-java/.cdata-artifacts/jni-dist \
surefire:test | tee /arrow-java/cdata-surefire.log
if grep -E "Compiling [0-9]+ source files?" /arrow-java/cdata-surefire.log; then
echo "Unexpected compilation occurred while running prebuilt C Data tests."
exit 1
fi
if ! grep -q "Tests run:" /arrow-java/cdata-surefire.log; then
echo "No C Data surefire test summary found; tests may have been skipped."
exit 1
fi
'
integration:
name: AMD64 integration
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 60
steps:
- name: Check integration relevance
id: integration-changes
uses: actions/github-script@v8
with:
script: |
if (context.eventName === 'workflow_dispatch' && ${{ inputs.skip_integration }}) {
core.setOutput('should_run', 'false');
core.notice('Manual run requested without integration tests.');
return;
}
if (context.eventName !== 'pull_request') {
core.setOutput('should_run', 'true');
return;
}
const files = await github.paginate(
github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
}
);
const relevant = files.some(({ filename }) =>
filename === 'compose.yaml' ||
filename === 'pom.xml' ||
filename === '.github/workflows/test.yml' ||
filename.startsWith('c/') ||
filename.startsWith('flight/') ||
filename.startsWith('format/') ||
filename.startsWith('vector/') ||
filename.startsWith('ci/scripts/') ||
filename.startsWith('testing/data/') ||
filename.endsWith('/pom.xml')
);
core.setOutput('should_run', relevant ? 'true' : 'false');
core.notice(
relevant
? 'Integration-relevant changes detected; running integration tests.'
: 'No integration-relevant changes detected; skipping integration tests.'
);
- name: Checkout Arrow
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
fetch-depth: 0
repository: apache/arrow
submodules: recursive
- name: Checkout Arrow Rust
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
repository: apache/arrow-rs
path: rust
- name: Checkout Arrow nanoarrow
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
repository: apache/arrow-nanoarrow
path: nanoarrow
- name: Checkout Arrow .NET
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
repository: apache/arrow-dotnet
path: dotnet
- name: Checkout Arrow Go
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
repository: apache/arrow-go
path: go
- name: Checkout Arrow Java
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
path: java
- name: Checkout Arrow JavaScript
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/checkout@v6
with:
repository: apache/arrow-js
path: js
- name: Free up disk space
if: steps.integration-changes.outputs.should_run == 'true'
run: |
ci/scripts/util_free_space.sh
- name: Cache Docker Volumes
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/cache@v5
with:
path: .docker
key: integration-conda-${{ hashFiles('cpp/**') }}
restore-keys: integration-conda-
- name: Setup Python
if: steps.integration-changes.outputs.should_run == 'true'
uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Setup Archery
if: steps.integration-changes.outputs.should_run == 'true'
run: pip install -e dev/archery[docker]
- name: Execute Docker Build
if: steps.integration-changes.outputs.should_run == 'true'
run: |
source ci/scripts/util_enable_core_dumps.sh
archery docker run \
-e ARCHERY_DEFAULT_BRANCH=main \
-e ARCHERY_INTEGRATION_TARGET_IMPLEMENTATIONS=java \
-e ARCHERY_INTEGRATION_WITH_DOTNET=1 \
-e ARCHERY_INTEGRATION_WITH_GO=1 \
-e ARCHERY_INTEGRATION_WITH_JAVA=1 \
-e ARCHERY_INTEGRATION_WITH_JS=1 \
-e ARCHERY_INTEGRATION_WITH_NANOARROW=1 \
-e ARCHERY_INTEGRATION_WITH_RUST=1 \
conda-integration