Skip to content

Commit 6f48c5d

Browse files
committed
CI: Support s390x build
- Add cross-compilation job for s390x using QEMU - Increase test timeouts in CMakeLists.txt for emulated environment Signed-off-by: Anemptyship <hanbin1931@gmail.com>
1 parent aa7c55a commit 6f48c5d

File tree

2 files changed

+59
-13
lines changed

2 files changed

+59
-13
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
8+
workflow_dispatch:
89

910
jobs:
1011
build-linux-amd64:
@@ -68,6 +69,25 @@ jobs:
6869
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-arm -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/arm64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
6970
cmake --build ${{github.workspace}}/build-arm
7071
72+
build-linux-s390x:
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@v6
77+
78+
- name: Set up CMake
79+
uses: jwlawson/actions-setup-cmake@v2
80+
81+
- name: Install s390x toolchain
82+
run: |
83+
sudo apt-get update
84+
sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu binutils-s390x-linux-gnu libc6-s390x-cross
85+
86+
- name: Build (crosscompile) PC Linux s390x
87+
run: |
88+
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-s390x -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release
89+
cmake --build ${{github.workspace}}/build-s390x
90+
7191
build-darwin-arm64:
7292
runs-on: macos-latest
7393
steps:
@@ -124,3 +144,29 @@ jobs:
124144
with:
125145
name: LastTest.log
126146
path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log
147+
148+
test-linux-s390x:
149+
runs-on: ubuntu-latest
150+
env:
151+
QEMU_LD_PREFIX: /usr/s390x-linux-gnu
152+
steps:
153+
- name: Checkout code
154+
uses: actions/checkout@v6
155+
156+
- name: Set up CMake
157+
uses: jwlawson/actions-setup-cmake@v2
158+
159+
- name: Install s390x toolchain and emulator
160+
run: |
161+
sudo apt-get update
162+
sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu binutils-s390x-linux-gnu libc6-s390x-cross qemu-user qemu-user-static
163+
164+
- name: Build (crosscompile) PC Linux s390x for tests
165+
run: |
166+
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-s390x -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-s390x;-L;/usr/s390x-linux-gnu"
167+
cmake --build ${{github.workspace}}/build-s390x
168+
169+
- name: Run tests for s390x
170+
run: |
171+
cd build-s390x
172+
ctest --output-on-failure --timeout 15

CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ set_tests_properties(encode PROPERTIES
272272
# Test - decode
273273
add_test(NAME decode COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i out.oapv)
274274
set_tests_properties(decode PROPERTIES
275-
TIMEOUT 10
275+
TIMEOUT 20
276276
DEPENDS encode
277277
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
278278
PASS_REGULAR_EXPRESSION "Decoded frame count = 125"
@@ -282,7 +282,7 @@ set_tests_properties(decode PROPERTIES
282282
# Test - decode qp_A.apv
283283
add_test(NAME decode_qp_A COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/qp_A.apv -v 3 --hash)
284284
set_tests_properties(decode_qp_A PROPERTIES
285-
TIMEOUT 10
285+
TIMEOUT 20
286286
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
287287
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
288288
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -291,7 +291,7 @@ set_tests_properties(decode_qp_A PROPERTIES
291291
# Test - decode qp_B.apv
292292
add_test(NAME decode_qp_B COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/qp_B.apv -v 3 --hash)
293293
set_tests_properties(decode_qp_B PROPERTIES
294-
TIMEOUT 10
294+
TIMEOUT 20
295295
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
296296
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
297297
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -300,7 +300,7 @@ set_tests_properties(decode_qp_B PROPERTIES
300300
# Test - decode qp_C.apv
301301
add_test(NAME decode_qp_C COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/qp_C.apv -v 3 --hash)
302302
set_tests_properties(decode_qp_C PROPERTIES
303-
TIMEOUT 10
303+
TIMEOUT 20
304304
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
305305
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
306306
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -309,7 +309,7 @@ set_tests_properties(decode_qp_C PROPERTIES
309309
# Test - decode qp_D.apv
310310
add_test(NAME decode_qp_D COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/qp_D.apv -v 3 --hash)
311311
set_tests_properties(decode_qp_D PROPERTIES
312-
TIMEOUT 10
312+
TIMEOUT 20
313313
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
314314
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
315315
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -318,7 +318,7 @@ set_tests_properties(decode_qp_D PROPERTIES
318318
# Test - decode qp_E.apv
319319
add_test(NAME decode_qp_E COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/qp_E.apv -v 3 --hash)
320320
set_tests_properties(decode_qp_E PROPERTIES
321-
TIMEOUT 10
321+
TIMEOUT 20
322322
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
323323
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
324324
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -327,7 +327,7 @@ set_tests_properties(decode_qp_E PROPERTIES
327327
# Test - decode syn_A.apv
328328
add_test(NAME decode_syn_A COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/syn_A.apv -v 3 --hash)
329329
set_tests_properties(decode_syn_A PROPERTIES
330-
TIMEOUT 10
330+
TIMEOUT 20
331331
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
332332
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
333333
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -336,7 +336,7 @@ set_tests_properties(decode_syn_A PROPERTIES
336336
# Test - decode syn_B.apv
337337
add_test(NAME decode_syn_B COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/syn_B.apv -v 3 --hash)
338338
set_tests_properties(decode_syn_B PROPERTIES
339-
TIMEOUT 10
339+
TIMEOUT 20
340340
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
341341
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
342342
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -345,7 +345,7 @@ set_tests_properties(decode_syn_B PROPERTIES
345345
# Test - decode tile_A.apv
346346
add_test(NAME decode_tile_A COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/tile_A.apv -v 3 --hash)
347347
set_tests_properties(decode_tile_A PROPERTIES
348-
TIMEOUT 10
348+
TIMEOUT 20
349349
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
350350
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
351351
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -354,7 +354,7 @@ set_tests_properties(decode_tile_A PROPERTIES
354354
# Test - decode tile_B.apv
355355
add_test(NAME decode_tile_B COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/tile_B.apv -v 3 --hash)
356356
set_tests_properties(decode_tile_B PROPERTIES
357-
TIMEOUT 10
357+
TIMEOUT 20
358358
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
359359
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
360360
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -363,7 +363,7 @@ set_tests_properties(decode_tile_B PROPERTIES
363363
# Test - decode tile_C.apv
364364
add_test(NAME decode_tile_C COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/tile_C.apv -v 3 --hash)
365365
set_tests_properties(decode_tile_C PROPERTIES
366-
TIMEOUT 10
366+
TIMEOUT 20
367367
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
368368
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
369369
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -372,7 +372,7 @@ set_tests_properties(decode_tile_C PROPERTIES
372372
# Test - decode tile_D.apv
373373
add_test(NAME decode_tile_D COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/tile_D.apv -v 3 --hash)
374374
set_tests_properties(decode_tile_D PROPERTIES
375-
TIMEOUT 10
375+
TIMEOUT 20
376376
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
377377
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
378378
PASS_REGULAR_EXPRESSION ".*hash:match.*"
@@ -381,7 +381,7 @@ set_tests_properties(decode_tile_D PROPERTIES
381381
# Test - decode tile_E.apv
382382
add_test(NAME decode_tile_E COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/oapv_app_dec -i ${CMAKE_CURRENT_SOURCE_DIR}/test/bitstream/tile_E.apv -v 3 --hash)
383383
set_tests_properties(decode_tile_E PROPERTIES
384-
TIMEOUT 10
384+
TIMEOUT 20
385385
FAIL_REGULAR_EXPRESSION "Decoded frame count = 0"
386386
PASS_REGULAR_EXPRESSION "Decoded frame count = 3"
387387
PASS_REGULAR_EXPRESSION ".*hash:match.*"

0 commit comments

Comments
 (0)