Skip to content

Commit 5b9ddc4

Browse files
Add git workflow for s390x cross testing
1 parent a2d41e3 commit 5b9ddc4

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/cross-s390x.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: IBM Z cross-compilation build
2+
on: [push, pull_request]
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: '${{ matrix.target.platform }}, ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}'
11+
strategy:
12+
matrix:
13+
target:
14+
- { platform: 's390x', dir: 's390x-linux-gnu', flags: '-mzvector -march=z14', full: 'OFF' }
15+
sys:
16+
- { compiler: 'gcc', version: '14' }
17+
steps:
18+
- name: Setup compiler
19+
if: ${{ matrix.sys.compiler == 'gcc' }}
20+
run: |
21+
sudo apt-get update || exit 1
22+
sudo apt-get --no-install-suggests --no-install-recommends install g++-${{ matrix.sys.version }}-${{ matrix.target.dir }} g++-${{ matrix.sys.version }}-multilib || exit 1
23+
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-gcc || true
24+
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-g++ || true
25+
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-gcc ${{ matrix.target.dir }}-gcc /usr/bin/${{ matrix.target.dir }}-gcc-${{ matrix.sys.version }} 20
26+
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-g++ ${{ matrix.target.dir }}-g++ /usr/bin/${{ matrix.target.dir }}-g++-${{ matrix.sys.version }} 20
27+
- name: Setup QEMU
28+
run: |
29+
sudo apt-get --no-install-suggests --no-install-recommends install qemu-user
30+
- name: Setup Ninja
31+
run: |
32+
sudo apt-get install ninja-build
33+
- name: Checkout xsimd
34+
uses: actions/checkout@v6
35+
- name: Setup
36+
run: |
37+
cmake -B _build \
38+
-DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON \
39+
-DBUILD_BENCHMARK=${{ matrix.target.full }} -DBUILD_EXAMPLES=${{ matrix.target.full }} \
40+
-DCMAKE_BUILD_TYPE=Release \
41+
-DCMAKE_C_FLAGS="${{ matrix.target.flags }}" \
42+
-DCMAKE_CXX_FLAGS="${{ matrix.target.flags }}" \
43+
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-${{ matrix.target.dir }}.cmake
44+
- name: Build
45+
run: cmake --build _build --verbose -j1
46+
- name: Testing xsimd
47+
run: qemu-${{ matrix.target.platform }} -cpu z14 -L /usr/${{ matrix.target.dir}}/ ./test/test_xsimd
48+
working-directory: ${{ github.workspace }}/_build

0 commit comments

Comments
 (0)