Skip to content

Other-architectures-isolated #2502

Other-architectures-isolated

Other-architectures-isolated #2502

name: Other-architectures-isolated
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
# https://github.com/uraimo/run-on-arch-action
on:
pull_request:
types: [opened, reopened, synchronize]
schedule:
- cron: '0 2 * * SUN'
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
# https://github.com/orgs/community/discussions/28474#discussioncomment-3350256
check_skip_flags:
name: Check skip flags
runs-on: ubuntu-latest
outputs:
head-commit-message: ${{ steps.get_head_commit_message.outputs.headCommitMsg }}
steps:
- name: Get repo
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Print head git commit message
id: get_head_commit_message
run: echo "headCommitMsg=$(git show -s --format=%s)" >> $GITHUB_OUTPUT
build-other-architectures-isolated:
# The host should always be linux
runs-on: ubuntu-latest
needs: check_skip_flags
if: >-
${{
(!contains(needs.check_skip_flags.outputs.head-commit-message, '[SKIP-CI ALL]') &&
!contains(needs.check_skip_flags.outputs.head-commit-message, '[SKIP-CI OTHER-ARCH-ISOLATED]')) ||
contains(needs.check_skip_flags.outputs.head-commit-message, '[ENABLE-CI OTHER-ARCH-ISOLATED]')
}}
name: Build on ${{ matrix.distro }} ${{ matrix.arch }} ${{ matrix.endianness }}
# Run steps on a matrix of different arch/distro combinations
strategy:
fail-fast: false
matrix:
include:
# - arch: armv6
# distro: bullseye
# target: ARMV6
#- arch: armv7
# distro: ubuntu:latest
# target: ARMV7
# endianness: (Little Endian)
# - arch: aarch64
# distro: ubuntu:latest
# endianness: (Little Endian)
- arch: riscv64
distro: ubuntu:latest
target: RISC-V
endianness: (Little Endian)
- arch: ppc64le
distro: ubuntu:latest
target: POWER8
endianness: (Little Endian)
- arch: s390x
distro: ubuntu:latest
target: Z13
endianness: (Big Endian)
steps:
- name: Checkout repository
uses: actions/checkout@v5
# Ajout de Swap pour éviter l'erreur "Cannot allocate memory" lors du linking sur RISC-V
- name: Set up Swap Space
uses: thejerrybao/setup-swap-space@v1
with:
swap-space-path: /swapfile
swap-size-gb: 4
remove-existing-swap-files: true
- name: Run on arch
uses: uraimo/run-on-arch-action@v3
# See issue https://github.com/uraimo/run-on-arch-action/issues/155 for the explanation on the weird use of the arch and distro
# that resulted in error
# ERROR: failed to solve: ${arch}/ubuntu:latest: failed to resolve source metadata for docker.io/${arch}/ubuntu:latest: no match for platform in manifest: not found
with:
githubToken: ${{ github.token }}
arch: none
distro: none
base_image: "--platform=linux/${{ matrix.arch }} ${{ matrix.distro }}"
install: |
apt-get update && apt-get install -y lsb-release git build-essential cmake
run: |
lscpu
lsb_release -a
dpkg --list | grep compiler
pwd
mkdir build && cd build
cmake .. -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TUTORIALS=OFF -DBUILD_JAVA=OFF \
-DUSE_JPEG=OFF -DUSE_PNG=OFF -DUSE_X11=OFF -DUSE_XML2=OFF -DBUILD_JAVA=OFF -DUSE_BLAS/LAPACK=OFF -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-keep-memory"
cat ViSP-third-party.txt
ARCHI=`uname -m`
if [[ ${ARCHI} == *"riscv"* ]]
then
# riscv64 cannot currently run on more than 1 processor
NB_PROC_TO_USE=1
TIMEOUT=4000
else
if [[ $(nproc) -gt 3 ]]
then
NB_PROC_TO_USE=`expr $(nproc) - 2`
TIMEOUT=2000
else
NB_PROC_TO_USE=1
TIMEOUT=4000
fi
fi
echo "NB_PROC_TO_USE = ${NB_PROC_TO_USE}"
make -j${NB_PROC_TO_USE}
# increase default 1500 timeout on QEMU based CI tests
ctest -j${NB_PROC_TO_USE} --output-on-failure --timeout $TIMEOUT