diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index e2faff3c..ddef9ebd 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -45,11 +45,6 @@ jobs: - name: list compilers run: dpkg --list | grep compiler - - name: install ${{matrix.cxx}} - run: | - sudo add-apt-repository --yes --update ppa:ubuntu-toolchain-r/test - sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends ${{matrix.cxx}} - - name: Get pushed code uses: actions/checkout@v4 @@ -97,3 +92,31 @@ jobs: - name: Run tests run: ctest --test-dir _build + + s390X-BigEndian: + runs-on: ubuntu-latest + env: + CMAKE_OPTIONS: -DDEV_MODE=ON -DBUILD_TESTING=ON -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-s390x;-L;/usr/s390x-linux-gnu/" -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -G Ninja + steps: + - name: install toolchain + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends qemu-user crossbuild-essential-s390x qemu-system-s390x + + - name: list compilers + run: dpkg --list | grep compiler + + - name: Get pushed code + uses: actions/checkout@v4 + + - name: Configure + run: cmake -S . -B _build ${{ env.CMAKE_OPTIONS }} -DCMAKE_INSTALL_PREFIX:STRING=${GITHUB_WORKSPACE}/_built + + - name: Build + run: cmake --build _build --parallel + + - name: Test installation + run: cmake --install _build --prefix ${GITHUB_WORKSPACE}/_built + + - name: Run tests + run: ctest --test-dir _build diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 56dd85cb..8bfee689 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -8,15 +8,15 @@ on: jobs: build_libebml: name: libebml ${{ matrix.arch.name }} ${{ matrix.config }} - runs-on: windows-latest + runs-on: ${{ matrix.arch.runner }} strategy: fail-fast: false matrix: config: [Debug, Release] arch: [ - { "name": "x64", "option": "x64", "env": "AMD64"}, - { "name": "x86", "option": "win32", "env": "X86"}, - { "name": "arm64", "option": "arm64", "env": "ARM64"}, + { "name": "x64", "option": "x64", "runner": "windows-latest"}, + { "name": "x86", "option": "win32", "runner": "windows-latest"}, + { "name": "arm64", "option": "arm64", "runner": "windows-11-arm"}, ] env: CMAKE_OPTIONS: -DDEV_MODE=ON -DCMAKE_CXX_FLAGS_INIT="-DWINVER=0x0501" -DBUILD_TESTING=ON @@ -34,7 +34,4 @@ jobs: run: cmake --install _build --config ${{ matrix.config }} --prefix ${GITHUB_WORKSPACE}/_built - name: Run tests - run: | - if ($env:PROCESSOR_ARCHITECTURE -match "${{ matrix.arch.env }}") { - ctest --test-dir _build - } + run: ctest --test-dir _build --build-config ${{ matrix.config }} diff --git a/CMakeLists.txt b/CMakeLists.txt index e4b56078..4572a472 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,8 +123,16 @@ if(WIN32) target_compile_definitions(ebml PRIVATE _CRT_SECURE_NO_WARNINGS) endif() -include(TestBigEndian) -test_big_endian(BUILD_BIG_ENDIAN) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20") + if(${CMAKE_CXX_BYTE_ORDER} STREQUAL "BIG_ENDIAN") + set(BUILD_BIG_ENDIAN 1) + else() + set(BUILD_BIG_ENDIAN 0) + endif() +else() + include(TestBigEndian) + test_big_endian(BUILD_BIG_ENDIAN) +endif() if(BUILD_BIG_ENDIAN) target_compile_definitions(ebml PRIVATE BUILD_BIG_ENDIAN) else() @@ -147,35 +155,35 @@ if (BUILD_TESTING) add_executable(test_id test/test_id.cxx) target_link_libraries(test_id PUBLIC ebml) - add_test(test_id test_id) + add_test(NAME test_id COMMAND test_id) add_executable(test_header test/test_header.cxx) target_link_libraries(test_header PUBLIC ebml) - add_test(test_header test_header) + add_test(NAME test_header COMMAND test_header) add_executable(test_infinite test/test_infinite.cxx) target_link_libraries(test_infinite PUBLIC ebml) - add_test(test_infinite test_infinite) + add_test(NAME test_infinite COMMAND test_infinite) add_executable(test_utfstring test/test_utfstring.cxx) target_link_libraries(test_utfstring PUBLIC ebml) - add_test(test_utfstring test_utfstring) + add_test(NAME test_utfstring COMMAND test_utfstring) add_executable(test_macros test/test_macros.cxx) target_link_libraries(test_macros PUBLIC ebml) - add_test(test_macros test_macros) + add_test(NAME test_macros COMMAND test_macros) add_executable(test_crc test/test_crc.cxx) target_link_libraries(test_crc PUBLIC ebml) - add_test(test_crc test_crc) + add_test(NAME test_crc COMMAND test_crc) add_executable(test_missing test/test_missing.cxx) target_link_libraries(test_missing PUBLIC ebml) - add_test(test_missing test_missing) + add_test(NAME test_missing COMMAND test_missing) add_executable(test_versioning test/test_versioning.cxx) target_link_libraries(test_versioning PUBLIC ebml) - add_test(test_versioning test_versioning) + add_test(NAME test_versioning COMMAND test_versioning) endif(BUILD_TESTING)