diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e21ffb57..0d0efeb6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,16 +79,56 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Pull run: | - docker compose pull debian-go || : + docker compose pull debian || : - name: Test run: | - docker compose run debian-go + docker compose run debian - name: Push if: >- success() && github.event_name == 'push' && github.repository == 'apache/arrow-go' && github.ref_name == 'main' continue-on-error: true run: | - docker compose push debian-go + docker compose push debian + docker-cgo: + name: AMD64 Debian 12 Go ${{ matrix.go }} - CGO + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + go: + - '1.22' + - '1.23' + env: + GO: ${{ matrix.go }} + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + submodules: recursive + - name: Login to GitHub Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Pull + run: | + docker compose pull debian || : + docker compose pull debian-cgo || : + - name: Build + run: | + docker compose build debian + docker compose build debian-cgo + - name: Test + run: | + docker compose run debian-cgo + - name: Push + if: >- + success() && github.event_name == 'push' && github.repository == 'apache/arrow-go' && github.ref_name == 'main' + continue-on-error: true + run: | + docker compose push debian-cgo macos: name: AMD64 macOS 12 Go ${{ matrix.go }} runs-on: macos-12 diff --git a/ci/docker/debian-cgo.dockerfile b/ci/docker/debian-cgo.dockerfile new file mode 100644 index 00000000..d6171d38 --- /dev/null +++ b/ci/docker/debian-cgo.dockerfile @@ -0,0 +1,37 @@ +# 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. + +ARG base +FROM ${base} + +ENV DEBIAN_FRONTEND noninteractive + +# install libarrow-dev to link against with CGO +RUN apt-get update -y -q && \ + apt-get install -y -q --no-install-recommends \ + ca-certificates \ + lsb-release \ + wget && \ + wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \ + apt-get install -y -q --no-install-recommends \ + ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \ + rm -f apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \ + apt-get update -y -q && \ + apt-get install -y -q --no-install-recommends \ + cmake \ + libarrow-dev && \ + apt-get clean diff --git a/compose.yaml b/compose.yaml index a17de305..42d306bc 100644 --- a/compose.yaml +++ b/compose.yaml @@ -26,10 +26,10 @@ # $ ARCH=arm64v8 docker compose run debian-go services: - debian-go: + debian: # Usage: - # docker compose build debian-go - # docker compose run debian-go + # docker compose build debian + # docker compose run debian image: ${REPO}:${ARCH}-debian-${DEBIAN}-${GO} build: context: . @@ -47,3 +47,20 @@ services: git config --global --add safe.directory /arrow-go && \ /arrow-go/ci/scripts/build.sh /arrow-go && \ /arrow-go/ci/scripts/test.sh /arrow-go" + debian-cgo: + # Usage: + # docker compose build debian-cgo + # docker compose run debian-cgo + image: ${REPO}:${ARCH}-debian-${DEBIAN}-${GO}-cgo + build: + context: . + dockerfile: ci/docker/debian-cgo.dockerfile + cache_from: + - ${REPO}:${ARCH}-debian-${DEBIAN}-${GO}-cgo + args: + base: ${REPO}:${ARCH}-debian-${DEBIAN}-${GO} + shm_size: *shm-size + volumes: *debian-volumes + environment: + ARROW_GO_TESTCGO: "1" + command: *go-command