Skip to content

Commit

Permalink
build: use prebuild containers for builds
Browse files Browse the repository at this point in the history
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 <dwagner@suse.de>
  • Loading branch information
igaw committed Aug 31, 2023
1 parent edc4bd8 commit 6a8edf7
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 51 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 15 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 <<EOF
deb [arch=${{ matrix.port }}] http://ports.ubuntu.com/ $release main universe restricted"
deb [arch=${{ matrix.port }}] http://ports.ubuntu.com/ $release-updates main universe restricted"
EOF
sudo apt update
sudo apt install -y meson pkg-config qemu-user-static ${{ matrix.compiler}} libjson-c-dev:${{ matrix.port }} ${{ matrix.packages }}
- name: build
run: |
scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross
- name: enable foreign arch
uses: dbhi/qus/action@main
- name: compile and run unit tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/igaw/linux-nvme/ubuntu-cross-${{ matrix.arch }}:0.36
guest-dir: /build
host-dir: ${{ github.workspace }}
command: |
scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross
params: "--platform linux/amd64"
pull-params: "--platform linux/amd64"
- uses: actions/upload-artifact@v3
name: upload logs
if: failure()
Expand All @@ -79,13 +65,10 @@ jobs:
name: fallback shared libraries
runs-on: ubuntu-latest
container:
image: ghcr.io/igaw/linux-nvme/debian:0.30
image: ghcr.io/igaw/linux-nvme/debian:0.36
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: build
run: |
scripts/build.sh -b release -c gcc fallback
Expand All @@ -100,7 +83,7 @@ jobs:
name: muon minimal static
runs-on: ubuntu-latest
container:
image: ghcr.io/igaw/linux-nvme/debian:0.30
image: ghcr.io/igaw/linux-nvme/debian:0.36
steps:
- uses: actions/checkout@v3
- name: build
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: coverage

on:
push:
branches: [master]

jobs:
code-coverage:
name: code coverage
runs-on: ubuntu-latest
container:
image: ghcr.io/igaw/linux-nvme/debian.python:0.36
steps:
- uses: actions/checkout@v3
- name: build
run: |
scripts/build.sh coverage
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
42 changes: 40 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ usage() {
echo " fallback download all dependencies"
echo " and build them as shared libaries"
echo " cross use cross toolchain to build"
echo " coverage build coverage report"
echo " appimage build AppImage target"
echo ""
echo "configs with muon:"
echo " [default] minimal static build"
Expand Down Expand Up @@ -57,6 +59,8 @@ cd "$(git rev-parse --show-toplevel)" || exit 1

BUILDDIR="$(pwd)/.build-ci"

fn_exists() { declare -F "$1" > /dev/null; }

config_meson_default() {
CC="${CC}" "${MESON}" setup \
--werror \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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;

0 comments on commit 6a8edf7

Please sign in to comment.