diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-09 10:17:33 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-08-02 14:45:57 +0200 |
commit | 90e81fc9a9a44759525304db609563851451a0f0 (patch) | |
tree | 26611e11b5110f4a45b01a8c848df2621f0376e3 | |
parent | 47075c9f73c07a8ddfa1c4d3961adcac318298d6 (diff) | |
download | neard-90e81fc9a9a44759525304db609563851451a0f0.tar.gz |
ci: add GitHub actions for building
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r-- | .github/workflows/ci.yml | 79 | ||||
-rwxr-xr-x | ci/debian.sh | 32 | ||||
l--------- | ci/ubuntu.sh | 1 |
3 files changed, 112 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e48ee0e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (c) 2021 Canonical Ltd. +# Author: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> +# <krzk@kernel.org> +# Loosely based on https://github.com/linux-test-project/ltp +# +name: "Builds" +on: [push, pull_request] + +jobs: + job: + name: Build + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - container: "ubuntu:hirsute" + env: + CC: gcc + + - container: "ubuntu:focal" + env: + CC: gcc + + - container: "ubuntu:bionic" + env: + CC: gcc + + - container: "ubuntu:xenial" + env: + CC: gcc + + container: + image: ${{ matrix.container }} + env: ${{ matrix.env }} + + steps: + - name: Show OS + run: cat /etc/os-release + + - name: Git checkout + uses: actions/checkout@v2 + + - name: Install additional packages + run: | + INSTALL=${{ matrix.container }} + INSTALL="${INSTALL%%:*}" + INSTALL="${INSTALL%%/*}" + ./ci/$INSTALL.sh + if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi + + - name: Compiler version + run: $CC --version + + - name: Display environment and Linux version + run: | + test -f /etc/issue && cat /etc/issue + lsb_release -a || true + uname -a + cat /proc/cmdline + printenv + + - name: Configure + run: ./bootstrap-configure + + - name: Compile + run: make -j$(nproc) + + - name: Install + run: make install + + - name: Distribution check + run: make distcheck diff --git a/ci/debian.sh b/ci/debian.sh new file mode 100755 index 0000000..07b7c93 --- /dev/null +++ b/ci/debian.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (c) 2021 Canonical Ltd. +# Author: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> +# <krzk@kernel.org> +# + +set -eEx + +apt update + +# Some distros (e.g. Ubuntu Hirsute) might pull tzdata which asks questions +export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true + +# Choose some random place in Europe +echo "tzdata tzdata/Areas select Europe +tzdata tzdata/Zones/Europe select Berlin +" > /tmp/tzdata-preseed.txt +debconf-set-selections /tmp/tzdata-preseed.txt + +apt install -y --no-install-recommends \ + autoconf \ + autoconf-archive \ + automake \ + build-essential \ + libdbus-1-dev \ + libglib2.0-dev \ + libnl-3-dev \ + libnl-genl-3-dev \ + libtool \ + diff --git a/ci/ubuntu.sh b/ci/ubuntu.sh new file mode 120000 index 0000000..0edcb8b --- /dev/null +++ b/ci/ubuntu.sh @@ -0,0 +1 @@ +debian.sh
\ No newline at end of file |