Skip to content

Commit 709eaa2

Browse files
SoniEx2alexreinking
andcommitted
Add s390x GHA workflow
Co-Authored-By: Alex Reinking <[email protected]>
1 parent 786f8ea commit 709eaa2

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,55 @@ jobs:
185185
- run: make clang-debug
186186
- name: tests (wasm2c tests excluding memory64)
187187
run: ./test/run-tests.py wasm2c --exclude-dir memory64
188+
189+
build-arch:
190+
runs-on: ubuntu-latest
191+
strategy:
192+
fail-fast: false
193+
matrix:
194+
arch: [s390x]
195+
services: # still faster on debian...
196+
distcc:
197+
image: debian:latest
198+
options: --health-cmd distccmon-text --health-interval 5s --health-start-period 5m debian:latest bash -c "apt-get update && apt-get install -y g++-s390x-linux-gnu distcc && distccd --daemon --no-detach"
199+
ports:
200+
- 3632:3632
201+
env:
202+
QEMU_LD_PREFIX: /usr/${{matrix.arch}}-linux-gnu/
203+
steps:
204+
- uses: actions/setup-python@v1
205+
with:
206+
python-version: '3.x'
207+
- uses: actions/checkout@v1
208+
with:
209+
submodules: true
210+
- name: Set up QEMU
211+
if: ${{ matrix.arch != 'i386' }}
212+
uses: docker/setup-qemu-action@v2
213+
with:
214+
platforms: ${{matrix.arch}}
215+
image: "tonistiigi/binfmt:master"
216+
- name: install ninja
217+
run: sudo apt-get install ninja-build
218+
- name: install the toolchain
219+
run: sudo apt-get install g++-${{matrix.arch}}-linux-gnu
220+
- name: install distcc
221+
run: sudo apt-get install distcc
222+
- name: mkdir distcc symlinks
223+
run: sudo mkdir -p /opt/bin/distcc_symlinks
224+
- name: distcc symlink
225+
run: sudo ln -s /usr/bin/distcc /opt/bin/distcc_symlinks/${{matrix.arch}}-linux-gnu-gcc # only CC is needed
226+
- name: cmake
227+
run: cmake -S . -B out -G Ninja -DCMAKE_TOOLCHAIN_FILE=../scripts/TC-${{matrix.arch}}.cmake -DWITH_WASI=ON -DWERROR=OFF -Werror=dev -Wno-deprecated
228+
- name: build
229+
run: cmake --build out
230+
- name: check if generated files are up-to-date
231+
run: python ./scripts/check_clean.py
232+
- name: unittests
233+
run: cmake --build out --target run-unittests
234+
if: ${{ matrix.arch != 's390x' }} # currently broken...
235+
- name: c-api-tests
236+
run: cmake --build out --target run-c-api-tests
237+
if: ${{ matrix.arch != 's390x' }}
238+
- name: tests
239+
run: cmake --build out --target run-tests

scripts/TC-s390x.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set(CMAKE_SYSTEM_NAME Linux)
2+
3+
set(CMAKE_C_COMPILER /opt/bin/distcc_symlinks/s390x-linux-gnu-gcc)
4+
set(CMAKE_CXX_COMPILER s390x-linux-gnu-g++)
5+
6+
set(CMAKE_FIND_ROOT_PATH /usr/s390x-linux-gnu)
7+
8+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
9+
10+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
11+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

0 commit comments

Comments
 (0)