workflow_dispatch:
jobs:
- gcc-debug:
- name: gcc debug
+ default:
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ compiler: [gcc, clang]
+ buildtype: [debug, release]
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:0.30
steps:
- - name: install libraries
- run: sudo apt-get install meson gcc pkg-config libjson-c-dev libssl-dev python3-dev
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: build
run: |
- scripts/build.sh -b debug -c gcc
+ scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }}
- uses: actions/upload-artifact@v3
name: upload logs
if: failure()
path: |
.build-ci/meson-logs/*.txt
- gcc-release:
- name: gcc release
+ cross:
runs-on: ubuntu-latest
+ strategy:
+ 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:
- - name: install libraries
- run: sudo apt-get install meson gcc pkg-config libjson-c-dev libdbus-1-dev python3-dev
- uses: actions/checkout@v3
- - uses: actions/setup-python@v4
- with:
- python-version: '3.x'
- - name: build
- run: |
- scripts/build.sh -b release -c gcc libdbus
- - uses: actions/upload-artifact@v3
- name: upload logs
- if: failure()
- with:
- name: log files
- path: |
- .build-ci/meson-logs/*.txt
-
- gcc-release-static:
- name: gcc release static
- runs-on: ubuntu-latest
- steps:
- - name: install libraries
- run: sudo apt-get install meson gcc pkg-config libpam-dev libcap-ng-dev
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v4
- with:
- python-version: '3.x'
- - name: build
+ - name: set up arm architecture
run: |
- scripts/build.sh -b release -c gcc static
- - uses: actions/upload-artifact@v3
- name: upload logs
- if: failure()
- with:
- name: log files
- path: |
- .build-ci/meson-logs/*.txt
-
- clang-debug:
- name: clang debug
- runs-on: ubuntu-latest
- steps:
- - name: install libraries
- run: sudo apt-get install meson clang pkg-config libjson-c-dev libdbus-1-dev python3-dev
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v4
- with:
- python-version: '3.x'
+ 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 debug -c clang libdbus
+ scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross
- uses: actions/upload-artifact@v3
name: upload logs
if: failure()
path: |
.build-ci/meson-logs/*.txt
- clang-release:
- name: clang release
+ libdbus:
+ name: libdbus
runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:0.30
steps:
- - name: install libraries
- run: sudo apt-get install meson clang pkg-config libjson-c-dev libdbus-1-dev python3-dev
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: build
run: |
- scripts/build.sh -b release -c clang libdbus
+ scripts/build.sh -b release -c gcc libdbus
- uses: actions/upload-artifact@v3
name: upload logs
if: failure()
fallback-shared-libraries:
name: fallback shared libraries
runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:0.30
+ if: github.ref == 'refs/heads/master'
steps:
- - name: install libraries
- run: sudo apt-get install meson gcc pkg-config libpam-dev libcap-ng-dev
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
path: |
.build-ci/meson-logs/*.txt
- cross-armhf:
- name: cross armhf
- runs-on: ubuntu-latest
- steps:
- - name: set up arm architecture
- run: |
- export release=$(lsb_release -c -s)
- sudo dpkg --add-architecture armhf
- sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
- sudo dd of=/etc/apt/sources.list.d/armhf.list <<EOF
- deb [arch=armhf] http://ports.ubuntu.com/ $release main universe restricted"
- deb [arch=armhf] http://ports.ubuntu.com/ $release-updates main universe restricted"
- EOF
- sudo apt update
- - name: install armhf compiler
- run: sudo apt install meson gcc-arm-linux-gnueabihf pkg-config qemu-user-static
- - name: install libraries
- run: sudo apt install libjson-c-dev:armhf
- - uses: actions/checkout@v3
- - name: build
- run: |
- scripts/build.sh -b release -c gcc cross_armhf
- - uses: actions/upload-artifact@v3
- name: upload logs
- if: failure()
- with:
- name: log files
- path: |
- .build-ci/meson-logs/*.txt
-
- cross-ppc64le:
- name: cross ppc64le
- runs-on: ubuntu-latest
- steps:
- - name: set up ppc64le architecture
- run: |
- export release=$(lsb_release -c -s)
- sudo dpkg --add-architecture ppc64el
- sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
- sudo dd of=/etc/apt/sources.list.d/ppc64el.list <<EOF
- deb [arch=ppc64el] http://ports.ubuntu.com/ $release main universe restricted"
- deb [arch=ppc64el] http://ports.ubuntu.com/ $release-updates main universe restricted"
- EOF
- sudo apt update
- - name: install powerpc64le compiler
- run: sudo apt install meson gcc-powerpc64le-linux-gnu pkg-config qemu-user-static
- - name: install libraries
- run: sudo apt install libjson-c-dev:ppc64el
- - uses: actions/checkout@v3
- - name: build
- run: |
- scripts/build.sh -b release -c gcc cross_ppc64le
- - uses: actions/upload-artifact@v3
- name: upload logs
- if: failure()
- with:
- name: log files
- path: |
- .build-ci/meson-logs/*.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 <<EOF
- deb [arch=s390x] http://ports.ubuntu.com/ $release main universe restricted"
- deb [arch=s390x] http://ports.ubuntu.com/ $release-updates main universe restricted"
- EOF
- sudo apt update
- - name: install s390x compiler
- run: sudo apt install meson gcc-s390x-linux-gnu libgcc-s1:s390x pkg-config qemu-user-static
- - name: install libraries
- run: sudo apt install libjson-c-dev:s390x
- - uses: actions/checkout@v3
- - name: build
- run: |
- scripts/build.sh -b release -c gcc cross_s390x
- - uses: actions/upload-artifact@v3
- name: upload logs
- if: failure()
- with:
- name: log files
- path: |
- .build-ci/meson-logs/*.txt
-
build-muon:
- name: muon minimal
+ name: muon minimal static
runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/igaw/linux-nvme/debian:0.30
steps:
- uses: actions/checkout@v3
- name: build
echo " -b [release]|debug build type"
echo " -c [gcc]|clang compiler to use"
echo " -m [meson]|muon use meson or muon"
+ echo " -t [arm]|ppc64le|s390x cross compile target"
echo ""
echo "configs with meson:"
echo " [default] default settings"
echo " libdbus build with libdbus"
- echo " static build without any depedencies and static"
echo " fallback download all dependencies"
echo " and build them as shared libaries"
- echo " cross_armhf build armhf with a cross compiler"
- echo " cross_ppc64le build ppc64le with a cross compiler"
- echo " cross_s390x build s390x with a cross compiler"
+ echo " cross use cross toolchain to build"
echo ""
echo "configs with muon:"
- echo " [default] minimal build"
+ echo " [default] minimal static build"
}
BUILDTOOL=meson
MESON=meson
BUILDTYPE=release
+CROSS_TARGET=arm
CC=${CC:-"gcc"}
-while getopts "b:c:m:" o; do
+while getopts "b:c:m:t:" o; do
case "${o}" in
b)
BUILDTYPE="${OPTARG}"
m)
BUILDTOOL="${OPTARG}"
;;
+ t)
+ CROSS_TARGET="${OPTARG}"
+ ;;
*)
usage
exit 1
"${BUILDDIR}"
}
-config_meson_static() {
- CC="${CC}" CFLAGS="${CFLAGS} -static" \
- "${MESON}" setup \
- --werror \
- --buildtype="${BUILDTYPE}" \
- --default-library=static \
- -Dlibdbus=disabled \
- -Dopenssl=disabled \
- -Dkeyutils=disabled \
- -Dpython=disabled \
- "${BUILDDIR}"
-}
-
config_meson_fallback() {
CC="${CC}" "${MESON}" setup \
--werror \
"${BUILDDIR}"
}
-config_meson_cross_armhf() {
- CC="${CC}" "${MESON}" setup \
- --werror \
- --buildtype="${BUILDTYPE}" \
- --cross-file=.github/cross/ubuntu-armhf.txt \
- -Dpython=disabled \
- "${BUILDDIR}"
-}
-
-config_meson_cross_ppc64le() {
+config_meson_cross() {
CC="${CC}" "${MESON}" setup \
--werror \
--buildtype="${BUILDTYPE}" \
- --cross-file=.github/cross/ubuntu-ppc64le.txt \
+ --cross-file=.github/cross/ubuntu-cross-"${CROSS_TARGET}".txt \
-Dpython=disabled \
+ -Dopenssl=disabled \
"${BUILDDIR}"
}
-config_meson_cross_s390x() {
- CC="${CC}" "${MESON}" setup \
- --werror \
- --buildtype="${BUILDTYPE}" \
- --cross-file=.github/cross/ubuntu-s390x.txt \
- -Dpython=disabled \
- "${BUILDDIR}"
-}
build_meson() {
"${MESON}" compile \
-C "${BUILDDIR}"
test_meson() {
"${MESON}" test \
+ --verbose \
-C "${BUILDDIR}"
}
+tools_build_samurai() {
+ mkdir -p "${BUILDDIR}"/build-tools
+ git clone --depth 1 https://github.com/michaelforney/samurai.git \
+ "${BUILDDIR}/build-tools/samurai"
+ pushd "${BUILDDIR}/build-tools/samurai" || exit 1
+
+ CC="${CC}" make
+ SAMU="${BUILDDIR}/build-tools/samurai/samu"
+
+ popd || exit 1
+}
+
tools_build_muon() {
mkdir -p "${BUILDDIR}"/build-tools
- git clone --depth 1 https://git.sr.ht/~lattis/muon "${BUILDDIR}/build-tools/muon"
+ git clone --depth 1 https://git.sr.ht/~lattis/muon \
+ "${BUILDDIR}/build-tools/muon"
pushd "${BUILDDIR}/build-tools/muon" || exit 1
- CC="${CC}" ./tools/bootstrap_ninja.sh build
- SAMU="${BUILDDIR}/build-tools/muon/build/samu"
-
- CC="${CC}" ninja="${SAMU}" ./bootstrap.sh build
- BOOTSTRAP_MUON="${BUILDDIR}/build-tools/muon/build/muon"
+ CC="${CC}" ninja="${SAMU}" ./bootstrap.sh stage1
- CC="${CC}" ninja="${SAMU}" ${BOOTSTRAP_MUON} setup \
- -Dlibcurl=disabled \
- -Dlibarchive=disabled \
+ CC="${CC}" ninja="${SAMU}" stage1/muon setup \
+ -Dprefix="${BUILDDIR}/build-tools" \
+ -Dlibcurl=enabled \
+ -Dlibarchive=enabled \
+ -Dlibpkgconf=enabled \
-Ddocs=disabled \
-Dsamurai=disabled \
- "${BUILDDIR}/build-tools/muon-bin"
- "${SAMU}" -C "${BUILDDIR}/build-tools/muon-bin"
- #"${BOOTSTRAP_MUON}" -C "${BUILDDIR}/build-tools/muon-bin" test
+ "${BUILDDIR}/build-tools/.build-muon"
+ "${SAMU}" -C "${BUILDDIR}/build-tools/.build-muon"
+ MUON="${BUILDDIR}/build-tools/.build-muon/muon"
- MUON="${BUILDDIR}/build-tools/muon-bin/muon"
+ # "${MUON}" -C "${BUILDDIR}/build-tools/.build-muon" test
popd || exit 1
}
config_muon_default() {
- # Need to explicitly disable python as muon currently
- # only partially supports the python module. It misses
- # the dependency() implementation
- ninja="${SAMU}" "${MUON}" setup \
+ CC="${CC}" CFLAGS="${CFLAGS} -static" \
+ ninja="${SAMU}" "${MUON}" setup \
+ -Ddefault_library=static \
+ -Djson-c=disabled \
+ -Dopenssl=disabled \
+ -Dkeyutils=disabled \
+ -Dpython=disabled \
-Dpython=disabled \
"${BUILDDIR}"
}
rm -rf "${BUILDDIR}"
if [[ "${BUILDTOOL}" == "muon" ]]; then
- if ! which samu || ! which muon ; then
- tools_build_muon
+ if ! which samu ; then
+ tools_build_samurai
else
SAMU="$(which samu)"
+ fi
+
+ if ! which muon ; then
+ tools_build_muon
+ else
MUON="$(which muon)"
fi
fi