Skip to content

Commit

Permalink
Merge pull request #11375 from rouault/ci_s390x
Browse files Browse the repository at this point in the history
CI: add minimal testing for s390x / big endian
  • Loading branch information
rouault authored Dec 2, 2024
2 parents 5e173b5 + 8540b80 commit 57833dc
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ jobs:
build_script: build.sh
os: ubuntu-22.04

- name: Ubuntu 24.04, s390x
id: s390x
container: s390x
build_script: build.sh
test_script: test.sh
os: ubuntu-22.04

name: ${{ matrix.name }}

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -183,6 +190,11 @@ jobs:
if: env.CONTAINER_REGISTRY == 'ghcr.io'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Enable Docker qemu
shell: bash -l {0}
run: |
docker run --rm --privileged linuxkit/binfmt:v0.8
# Pull build environment in forks or pull requests, unless [skip cache] is included in the commit message
- name: Pull build environment
if: "(github.repository_owner != 'OSGeo' || github.event_name == 'pull_request') && !contains(github.event.head_commit.message, '[skip cache]')"
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/s390x/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
ENV TARGET_ARCH=s390x
ENV GCC_ARCH=s390x
ENV APT_ARCH_SUFFIX=:s390x

RUN rm -f /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu noble-security main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe" >> /etc/apt/sources.list \
&& dpkg --add-architecture ${TARGET_ARCH} \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y g++-13-${GCC_ARCH}-linux-gnu \
&& ln -s ${GCC_ARCH}-linux-gnu-gcc-13 /usr/bin/${GCC_ARCH}-linux-gnu-gcc \
&& ln -s ${GCC_ARCH}-linux-gnu-g++-13 /usr/bin/${GCC_ARCH}-linux-gnu-g++

ENV CC=${GCC_ARCH}-linux-gnu-gcc-13
ENV CXX=${GCC_ARCH}-linux-gnu-g++-13

RUN apt-get update && \
apt-get install -y --allow-unauthenticated \
bash \
ccache \
cmake \
curl \
ninja-build \
libavif-dev${APT_ARCH_SUFFIX} \
libblosc-dev${APT_ARCH_SUFFIX} \
libboost-dev${APT_ARCH_SUFFIX} \
libcairo2-dev${APT_ARCH_SUFFIX} \
libcfitsio-dev${APT_ARCH_SUFFIX} \
libcrypto++-dev${APT_ARCH_SUFFIX} \
libcurl4-gnutls-dev${APT_ARCH_SUFFIX} \
libexpat-dev${APT_ARCH_SUFFIX} \
libfcgi-dev${APT_ARCH_SUFFIX} \
libfyba-dev${APT_ARCH_SUFFIX} \
libfreexl-dev${APT_ARCH_SUFFIX} \
libgeos-dev${APT_ARCH_SUFFIX} \
libgeotiff-dev${APT_ARCH_SUFFIX} \
libgif-dev${APT_ARCH_SUFFIX} \
libhdf4-alt-dev${APT_ARCH_SUFFIX} \
libhdf5-serial-dev${APT_ARCH_SUFFIX} \
libheif-dev${APT_ARCH_SUFFIX} \
libjpeg-dev${APT_ARCH_SUFFIX} \
libjxl-dev${APT_ARCH_SUFFIX} \
libkml-dev${APT_ARCH_SUFFIX} \
liblz4-dev${APT_ARCH_SUFFIX} \
liblzma-dev${APT_ARCH_SUFFIX} \
libmysqlclient-dev${APT_ARCH_SUFFIX} \
libnetcdf-dev${APT_ARCH_SUFFIX} \
libogdi-dev${APT_ARCH_SUFFIX} \
libopenexr-dev${APT_ARCH_SUFFIX} \
libopenjp2-7-dev${APT_ARCH_SUFFIX} \
libpcre3-dev${APT_ARCH_SUFFIX} \
libpng-dev${APT_ARCH_SUFFIX} \
libpoppler-dev${APT_ARCH_SUFFIX} \
libpoppler-private-dev${APT_ARCH_SUFFIX} \
libpq-dev${APT_ARCH_SUFFIX} \
libproj-dev${APT_ARCH_SUFFIX} \
librasterlite2-dev${APT_ARCH_SUFFIX} \
libspatialite-dev${APT_ARCH_SUFFIX} \
libssl-dev${APT_ARCH_SUFFIX} \
libwebp-dev${APT_ARCH_SUFFIX} \
libxerces-c-dev${APT_ARCH_SUFFIX} \
libxml2-dev${APT_ARCH_SUFFIX} \
libxslt-dev${APT_ARCH_SUFFIX} \
libzstd-dev${APT_ARCH_SUFFIX} \
python3-dev${APT_ARCH_SUFFIX} \
python3-numpy${APT_ARCH_SUFFIX} \
python3-setuptools${APT_ARCH_SUFFIX} \
python3-pip \
swig \
unixodbc-dev${APT_ARCH_SUFFIX} \
wget \
zip

COPY requirements.txt /tmp/
RUN python3 -m pip install -U --break-system-packages -r /tmp/requirements.txt
20 changes: 20 additions & 0 deletions .github/workflows/s390x/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -eu

CMAKE_ARGS=(
"-GNinja" \
"-DUSE_CCACHE=ON" \
"-DCMAKE_BUILD_TYPE=RelWithDebInfo" \
"-DCMAKE_INSTALL_PREFIX=/usr" \
"-DGDAL_USE_TIFF_INTERNAL=ON" \
"-DGDAL_USE_GEOTIFF_INTERNAL=ON" \
"-DBUILD_CSHARP_BINDINGS=OFF" \
"-DBUILD_JAVA_BINDINGS=OFF"
)

cmake ${GDAL_SOURCE_DIR:=..} \
"${CMAKE_ARGS[@]}"

ninja

10 changes: 10 additions & 0 deletions .github/workflows/s390x/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -eu

source ${GDAL_SOURCE_DIR:=..}/scripts/setdevenv.sh

autotest/cpp/gdal_unit_test --gtest_filter=-test_cpl.CPLSM_signed:test_cpl.CPLSpawn:test_cpl.CPLUTF8ForceToASCII

pytest autotest/alg
pytest autotest/gcore -k "not transformer and not virtualmem and not test_vrt_protocol_netcdf_component_name and not test_vsicrypt_3"

0 comments on commit 57833dc

Please sign in to comment.