Skip to content

Update dependencies #19

Update dependencies

Update dependencies #19

Workflow file for this run

# adapted from Numpy's linux-qemu.yml file
name: Linux Qemu tests
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
linux_qemu:
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
matrix:
BUILD_PROP:
- [
"armhf",
"arm-linux-gnueabihf",
"arm32v7/ubuntu:22.04",
"armhf-cross",
]
- [
"ppc64le",
"powerpc64le-linux-gnu",
"ppc64le/ubuntu:22.04",
"ppc64el-cross"
]
- [
"ppc64le - baseline(Power9)",
"powerpc64le-linux-gnu",
"ppc64le/ubuntu:22.04",
"ppc64el-cross",
]
- [
"s390x",
"s390x-linux-gnu",
"s390x/ubuntu:22.04",
"s390x-cross",
]
- [
"s390x - baseline(Z13)",
"s390x-linux-gnu",
"s390x/ubuntu:22.04",
"s390x-cross",
]
- [
"riscv64",
"riscv64-linux-gnu",
"riscv64/ubuntu:22.04",
"riscv64-cross",
]
env:
TOOLCHAIN_NAME: ${{ matrix.BUILD_PROP[1] }}
DOCKER_CONTAINER: ${{ matrix.BUILD_PROP[2] }}
LIBC_NAME: ${{ matrix.BUILD_PROP[3] }}
TERM: xterm-256color
name: "${{ matrix.BUILD_PROP[0] }}"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Initialize binfmt_misc for qemu-user-static
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Install GCC cross-compilers
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-${TOOLCHAIN_NAME} g++-${TOOLCHAIN_NAME} gfortran-${TOOLCHAIN_NAME}
- name: Cache docker container
uses: actions/cache@v3
id: container-cache
with:
path: ~/docker_${{ matrix.BUILD_PROP[1] }}
key: container-${{ runner.os }}-${{ matrix.BUILD_PROP[1] }}-${{ matrix.BUILD_PROP[2] }}
- name: Creates new container
if: steps.container-cache.outputs.cache-hit != 'true'
run: |
docker run --name the_container --interactive -v /:/host -v $(pwd):/gfort2py ${DOCKER_CONTAINER} /bin/bash -c "
apt-get update &&
apt-get install -y cmake git python3 python-is-python3 python3-dev python3-pip python3-numpy automake libc6-dev linux-libc-dev &&
mkdir -p /lib64 && ln -s /host/lib64/ld-* /lib64/ &&
ln -s /host/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu &&
rm -rf /usr/${TOOLCHAIN_NAME} && ln -s /host/usr/${TOOLCHAIN_NAME} /usr/${TOOLCHAIN_NAME} &&
rm -rf /usr/lib/gcc/${TOOLCHAIN_NAME} && ln -s /host/usr/lib/gcc-cross/${TOOLCHAIN_NAME} /usr/lib/gcc/${TOOLCHAIN_NAME} &&
rm -f /usr/bin/gcc && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-gcc /usr/bin/gcc &&
rm -f /usr/bin/g++ && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-g++ /usr/bin/g++ &&
rm -f /usr/bin/gfortran && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-gfortran /usr/bin/gfortran &&
rm -f /usr/bin/ar && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-ar /usr/bin/ar &&
rm -f /usr/bin/as && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-as /usr/bin/as &&
rm -f /usr/bin/ld && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-ld /usr/bin/ld &&
rm -f /usr/bin/ld.bfd && ln -s /host/usr/bin/${TOOLCHAIN_NAME}-ld.bfd /usr/bin/ld.bfd &&
rm -f /usr/bin/ninja && ln -s /host/usr/bin/ninja /usr/bin/ninja &&
rm -f /usr/include/stddef.h && ln -s /host/usr/include/${TOOLCHAIN_NAME}/include/stddef.h /usr/include/stddef.h &&
rm -f /usr/include/limits.h && ln -s /host/usr/include/${TOOLCHAIN_NAME}/include/limits.h /usr/include/limits.h &&
git config --global --add safe.directory /gfort2py &&
python -m pip install build wheel pytest cpyparsing platformdirs &&
rm -f /usr/local/bin/ninja && mkdir -p /usr/local/bin && ln -s /host/usr/bin/ninja /usr/local/bin/ninja
"
docker commit the_container the_container
mkdir -p "~/docker_${TOOLCHAIN_NAME}"
docker save -o "~/docker_${TOOLCHAIN_NAME}/the_container.tar" the_container
- name: Load container from cache
if: steps.container-cache.outputs.cache-hit == 'true'
run: docker load -i "~/docker_${TOOLCHAIN_NAME}/the_container.tar"
- name: Build
run: |
docker run --rm -e "TERM=xterm-256color" -v $(pwd):/gfort2py -v /:/host the_container \
/bin/script -e -q -c "/bin/bash --noprofile --norc -eo pipefail -c '
cd /gfort2py && python -m pip install .
'"
- name: Run Tests
run: |
docker run --rm -e "TERM=xterm-256color" -v $(pwd):/gfort2py -v /:/host the_container \
/bin/script -e -q -c "/bin/bash --noprofile --norc -eo pipefail -c '
export FC=/usr/bin/gfortran
cd /gfort2py && python -m pytest -v
'"