language: c
os: linux
dist: focal

jobs:
  include:
  - name: POWER9
    if: branch != master OR type == pull_request
    arch: ppc64le
    compiler: clang
    env:
    - CC="clang"
    - CXX="clang++"
    - CFLAGS="-mcpu=power9 -Weverything -Werror"
    - CXXFLAGS="-mcpu=power9 -Weverything -Werror"
    - JOBS="$(nproc)"
    addons:
      apt:
        packages: ninja-build python3-pip clang

  - name: z/Arch
    if: branch != master OR type == pull_request
    arch: s390x
    compiler: gcc
    env:
    - CC="gcc"
    - CXX="g++"
    - CFLAGS="-march=native -mzvector -Wextra -Werror"
    - CXXFLAGS="-march=native -mzvector -Wextra -Werror"
    - JOBS="$(nproc)"
    addons:
      apt:
        packages: ninja-build python3-pip gcc g++

before_install:
- cat /proc/cpuinfo
- cat /proc/meminfo

install:
- pip3 install meson==0.55.0

script:
- meson setup build -Db_coverage=true
- ninja -C build -v -j${JOBS}

after_success:
- meson test -C build --print-errorlogs

notifications:
  email: false
