From: Daniel Wagner Date: Thu, 31 Aug 2023 10:47:22 +0000 (+0200) Subject: build: use prebuild containers for builds X-Git-Tag: v2.6~52 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0fbf8b960ce758b71bc73c9fb23cfcde25a224c1;p=users%2Fsagi%2Fnvme-cli.git build: use prebuild containers for builds The builds keep failing because the install step fails. Use prebuild containers which contain all the dependencies. While at it, also add a coverage build. Signed-off-by: Daniel Wagner --- diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index f7b7ae08..b711ef7e 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -13,24 +13,14 @@ jobs: build-appimage: name: build AppImage runs-on: ubuntu-latest + container: + image: ghcr.io/igaw/linux-nvme/debian:0.36 steps: - - uses: actions/checkout@v3 - - name: install dependencies - run: sudo apt-get install libjson-c-dev libssl-dev libdbus-1-dev libhugetlbfs-dev - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - uses: BSFishy/meson-build@v1.0.3 - with: - setup-options: > - --werror - --buildtype=release - --prefix=/usr - --force-fallback-for=libnvme - -Dlibnvme:werror=false - action: install - meson-version: 0.61.2 - - name: build AppImage + - uses: actions/checkout@v3 + - name: build + run: | + scripts/build.sh appimage + - name: build AppImage uses: AppImageCrafters/build-appimage@v1.3 with: recipe: .github/AppImageBuilder.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3e2fd4e..1c687c9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,12 +17,9 @@ jobs: compiler: [gcc, clang] buildtype: [debug, release] container: - image: ghcr.io/igaw/linux-nvme/debian:0.30 + image: ghcr.io/igaw/linux-nvme/debian.python:0.36 steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - name: build run: | scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} @@ -40,33 +37,22 @@ jobs: matrix: include: - arch: armhf - port: armhf - compiler: gcc-arm-linux-gnueabihf - packages: - arch: s390x - port: s390x - compiler: gcc-s390x-linux-gnu - packages: libgcc-s1:s390x - arch: ppc64le - port: ppc64el - compiler: gcc-powerpc64le-linux-gnu - packges: steps: - uses: actions/checkout@v3 - - name: set up arm architecture - run: | - export release=$(lsb_release -c -s) - sudo dpkg --add-architecture ${{ matrix.port }} - sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list - sudo dd of=/etc/apt/sources.list.d/${{ matrix.arch }}.list < /dev/null; } + config_meson_default() { CC="${CC}" "${MESON}" setup \ --werror \ @@ -89,16 +93,49 @@ config_meson_cross() { "${BUILDDIR}" } +config_meson_coverage() { + CC="${CC}" "${MESON}" setup \ + --werror \ + --buildtype="${BUILDTYPE}" \ + --force-fallback-for=libnvme \ + -Dlibnvme:werror=false \ + -Db_coverage=true \ + "${BUILDDIR}" +} + +config_meson_appimage() { + CC="${CC}" "${MESON}" setup \ + --werror \ + --buildtype="${BUILDTYPE}" \ + --force-fallback-for=libnvme \ + --prefix=/usr \ + -Dlibnvme:werror=false \ + "${BUILDDIR}" +} + build_meson() { "${MESON}" compile \ -C "${BUILDDIR}" } +build_meson_coverage() { + ninja -C "${BUILDDIR}" coverage --verbose +} + test_meson() { "${MESON}" test \ -C "${BUILDDIR}" } +test_meson_covarage() { + true; +} + +install_meson_appimage() { + "${MESON}" install \ + -C "${BUILDDIR}" +} + tools_build_samurai() { mkdir -p "${BUILDDIR}"/build-tools git clone --depth 1 https://github.com/michaelforney/samurai.git \ @@ -173,5 +210,6 @@ if [[ "${BUILDTOOL}" == "muon" ]]; then fi config_"${BUILDTOOL}"_"${CONFIG}" -build_"${BUILDTOOL}" -test_"${BUILDTOOL}" +fn_exists "build_${BUILDTOOL}_${CONFIG}" && "build_${BUILDTOOL}_${CONFIG}" || build_"${BUILDTOOL}" +fn_exists "test_${BUILDTOOL}_${CONFIG}" && "test_${BUILDTOOL}_${CONFIG}" || test_"${BUILDTOOL}" +fn_exists "install_${BUILDTOOL}_${CONFIG}" && "install_${BUILDTOOL}_${CONFIG}" || true;