From 83cc7d43f5d5f4dd15dd015d2be243d5eced1083 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 16 Feb 2023 17:06:19 +0100 Subject: [PATCH] build: Add s390x cross build and enable cross tests Enable s390x cross builds and also run all tests when building cross. Signed-off-by: Daniel Wagner --- .github/cross/clang.txt | 3 ++ .github/cross/ubuntu-armhf.txt | 1 + .github/cross/ubuntu-ppc64le.txt | 1 + .github/cross/ubuntu-s390x.txt | 18 +++++++ .github/workflows/appimage.yml | 7 +-- .github/workflows/build.yml | 86 +++++++++++++++++++++----------- .github/workflows/release.yml | 11 ++-- 7 files changed, 90 insertions(+), 37 deletions(-) create mode 100644 .github/cross/ubuntu-s390x.txt diff --git a/.github/cross/clang.txt b/.github/cross/clang.txt index db001c5c..1484a3e7 100644 --- a/.github/cross/clang.txt +++ b/.github/cross/clang.txt @@ -1,2 +1,5 @@ [binaries] c = 'clang' +cpp = 'clang++' +strip = 'strip' +pkgconfig = 'pkg-config' diff --git a/.github/cross/ubuntu-armhf.txt b/.github/cross/ubuntu-armhf.txt index 2eee70b5..41c83289 100644 --- a/.github/cross/ubuntu-armhf.txt +++ b/.github/cross/ubuntu-armhf.txt @@ -4,6 +4,7 @@ ar = '/usr/arm-linux-gnueabihf/bin/ar' strip = '/usr/arm-linux-gnueabihf/bin/strip' pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' ld = '/usr/bin/arm-linux/gnueabihf-ld' +exe_wrapper = '/usr/bin/qemu-arm-static' [properties] root = '/usr/arm-linux-gnueabihf' diff --git a/.github/cross/ubuntu-ppc64le.txt b/.github/cross/ubuntu-ppc64le.txt index 4cf6a92a..6baaefbc 100644 --- a/.github/cross/ubuntu-ppc64le.txt +++ b/.github/cross/ubuntu-ppc64le.txt @@ -4,6 +4,7 @@ ar = '/usr/powerpc64le-linux-gnu/bin/ar' strip = '/usr/powerpc64le-linux-gnu/bin/strip' pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config' ld = '/usr/bin/powerpc64le-linux-gnu-ld' +exe_wrapper = '/usr/bin/qemu-ppc64le-static' [properties] root = '/usr/powerpc64le-linux-gnu' diff --git a/.github/cross/ubuntu-s390x.txt b/.github/cross/ubuntu-s390x.txt new file mode 100644 index 00000000..51a3511f --- /dev/null +++ b/.github/cross/ubuntu-s390x.txt @@ -0,0 +1,18 @@ +[binaries] +c = '/usr/bin/s390x-linux-gnu-gcc' +ar = '/usr/s390x-linux-gnu/bin/ar' +strip = '/usr/s390x-linux-gnu/bin/strip' +pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config' +ld = '/usr/bin/s390x-linux-gnu-ld' +exe_wrapper = '/usr/bin/qemu-s390x-static' + +[properties] +root = '/usr/s390x-linux-gnu' +has_function_printf = true +skip_sanity_check = true + +[host_machine] +system = 'linux' +cpu_family = 's390x' +cpu = '' +endian = 'big' diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 54fadc78..80b04962 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -1,16 +1,17 @@ --- -name: AppImage +name: appimage on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] env: DESTDIR: ../AppDir jobs: build-appimage: + name: build AppImage runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c258aea0..3f0b2031 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: install dependencies - run: sudo apt-get install libjson-c-dev libhugetlbfs-dev + run: sudo apt-get install gcc pkg-config libjson-c-dev libhugetlbfs-dev - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: @@ -23,7 +23,6 @@ jobs: - uses: bsfishy/meson-build@v1.0.3 with: action: test - options: --verbose setup-options: > --werror --buildtype=debug @@ -32,15 +31,15 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: gcc debug testlog - path: build/meson-logs/testlog.txt + name: gcc debug build log + path: build/meson-logs/meson-log.txt gcc-release: name: gcc release runs-on: ubuntu-latest steps: - name: install dependencies - run: sudo apt-get install libjson-c-dev libhugetlbfs-dev + run: sudo apt-get install gcc pkg-config libjson-c-dev libhugetlbfs-dev - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: @@ -48,7 +47,6 @@ jobs: - uses: bsfishy/meson-build@v1.0.3 with: action: test - options: --verbose setup-options: > --werror --buildtype=release @@ -57,15 +55,15 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: gcc release testlog - path: build/meson-logs/testlog.txt + name: gcc release build log + path: build/meson-logs/meson-log.txt clang-release: name: clang release runs-on: ubuntu-latest steps: - name: install dependencies - run: sudo apt-get install clang libjson-c-dev libhugetlbfs-dev + run: sudo apt-get install clang pkg-config libjson-c-dev libhugetlbfs-dev - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: @@ -73,7 +71,6 @@ jobs: - uses: bsfishy/meson-build@v1.0.3 with: action: test - options: --verbose setup-options: > --werror --buildtype=release @@ -84,8 +81,8 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: clang release testlog - path: build/meson-logs/testlog.txt + name: clang release build log + path: build/meson-logs/meson-log.txt fallback-shared-libraries: name: fallback shared libraries @@ -100,7 +97,6 @@ jobs: - uses: BSFishy/meson-build@v1.0.3 with: action: test - options: --verbose setup-options: > --werror --buildtype=release @@ -112,8 +108,8 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: fallback shared libaries testlog - path: build/meson-logs/testlog.txt + name: fallback shared libaries build log + path: build/meson-logs/meson-log.txt fallback-static-libraries: name: fallback static libraries @@ -128,7 +124,6 @@ jobs: - uses: BSFishy/meson-build@v1.0.3 with: action: test - options: --verbose setup-options: > --werror --buildtype=release @@ -140,8 +135,8 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: fallback static libaries testlog - path: build/meson-logs/testlog.txt + name: fallback static libaries build log + path: build/meson-logs/meson-log.txt cross-armhf: name: cross armhf @@ -158,27 +153,25 @@ jobs: EOF sudo apt update - name: install armhf compiler - run: sudo apt install gcc-arm-linux-gnueabihf pkg-config + run: sudo apt install gcc-arm-linux-gnueabihf pkg-config qemu-user-static - name: install libraries run: sudo apt install libjson-c-dev:armhf - uses: actions/checkout@v3 - uses: BSFishy/meson-build@v1.0.3 with: - action: build - options: --verbose + action: test setup-options: > --werror --buildtype=release --cross-file=.github/cross/ubuntu-armhf.txt - -Dlibnvme:werror=false -Dlibnvme:python=false -Dopenssl:werror=false meson-version: 0.61.2 - uses: actions/upload-artifact@v3 if: failure() with: - name: cross armhf testlog - path: build/meson-logs/testlog.txt + name: cross armhf build log + path: build/meson-logs/meson-log.txt cross-ppc64le: name: cross ppc64le @@ -195,14 +188,13 @@ jobs: EOF sudo apt update - name: install powerpc64le compiler - run: sudo apt install gcc-powerpc64le-linux-gnu pkg-config + run: sudo apt install gcc-powerpc64le-linux-gnu pkg-config qemu-user-static - name: install libraries run: sudo apt install libjson-c-dev:ppc64el - uses: actions/checkout@v3 - uses: BSFishy/meson-build@v1.0.3 with: - action: build - options: --verbose + action: test setup-options: > --werror --buildtype=release @@ -214,5 +206,41 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: cross ppc64le testlog - path: build/meson-logs/testlog.txt + name: cross ppc64le build log + path: build/meson-logs/meson-log.txt + + cross-s390x: + name: cross s390x + runs-on: ubuntu-latest + steps: + - name: set up s390x architecture + run: | + export release=$(lsb_release -c -s) + sudo dpkg --add-architecture s390x + sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list + sudo dd of=/etc/apt/sources.list.d/s390x.list < + --werror + --buildtype=release + --cross-file=.github/cross/ubuntu-s390x.txt + -Dlibnvme:werror=false + -Dlibnvme:python=false + -Dopenssl:werror=false + meson-version: 0.61.2 + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cross s390x build log + path: build/meson-logs/meson-log.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4ccb709..c88be9e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,12 @@ --- -name: releases +name: release on: push: branches: [ master ] tags: - '**' + jobs: build: runs-on: ubuntu-latest @@ -13,7 +14,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 - - uses: ncipollo/release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + - uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} -- 2.50.1