From patchwork Tue Nov 24 21:57:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 84524 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35B1DA04DB; Tue, 24 Nov 2020 22:57:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2235AC932; Tue, 24 Nov 2020 22:57:21 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 8D502C92E for ; Tue, 24 Nov 2020 22:57:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606255036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ErIR46L5bnlMPGdII1hk1yAKnc5cQEOhCdOb2J9mEc0=; b=Hcd4cQUYz5EaDv7cBAvVw97cLJ3J3bDu4z/VqHkfXBZ8VaVTrJDeHhfyHBwBtXRsO2ifgx 20It4pqpfweuaG7sp3S/Kx24pR1+Oe+yM4CVVAHihAoWHgRS4CAGk/7RGNs30tQWA+lnvL cQxz2TytDoRBWF+iRiBVS6VAQJCbBpY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-_qH4eeDFOom9qsIlG2ZzSQ-1; Tue, 24 Nov 2020 16:57:11 -0500 X-MC-Unique: _qH4eeDFOom9qsIlG2ZzSQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC24B835B61; Tue, 24 Nov 2020 21:57:09 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CAC419C45; Tue, 24 Nov 2020 21:57:07 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aaron Conole , Michael Santana , Thomas Monjalon Date: Tue, 24 Nov 2020 22:57:00 +0100 Message-Id: <20201124215700.12126-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH] ci: hook to Github Actions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" With the recent changes in terms of free access to the Travis CI, let's offer an alternative with Github Actions. Running jobs on ARM is not supported unless using external runners, so this commit only adds builds for x86_64 and cross compiling for i386 and aarch64. Differences with the Travis CI integration: - All jobs generate documentation. This is not that heavy and the default timeout on actions is never reached so no reason splitting this into multiple jobs. - Error logs are not dumped to the console when something goes wrong. Instead, they are gathered in a "catch-all" step and attached as artifacts. - A cache entry is stored once and for all, but if no cache is found you can inherit from the default branch cache. The cache is 5GB large, for the whole git repository. - The maximum retention of logs and artifacts is 3 months. - /home/runner is world writable, so a workaround has been added for starting dpdk processes. Signed-off-by: David Marchand Acked-by: Aaron Conole --- .ci/linux-build.sh | 4 +- .github/workflows/build.yml | 98 +++++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index d079801d78..a2a0e5bf42 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -12,7 +12,9 @@ on_error() { fi done } -trap on_error EXIT +# We capture the error logs as artifacts in Github Actions, no need to dump +# them via a EXIT handler. +[ -n "$GITHUB_WORKFLOW" ] || trap on_error EXIT install_libabigail() { version=$1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..e0a8f1ed52 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,98 @@ +name: build + +on: push + +defaults: + run: + shell: bash --noprofile --norc -exo pipefail {0} + +jobs: + build: + name: ${{ join(matrix.config.*, '-') }} + runs-on: ${{ matrix.config.os }} + env: + PKGS: | + ccache libnuma-dev python3-setuptools python3-wheel python3-pip \ + ninja-build libbsd-dev libpcap-dev libibverbs-dev libcrypto++-dev \ + libfdt-dev libjansson-dev doxygen graphviz python3-sphinx \ + python3-sphinx-rtd-theme + CC: ccache ${{ matrix.config.compiler }} + JOBNAME: ${{ join(matrix.config.*, '-') }} + + strategy: + fail-fast: false + matrix: + config: + - os: ubuntu-18.04 + compiler: gcc + library: static + - os: ubuntu-18.04 + compiler: gcc + library: shared + - os: ubuntu-18.04 + compiler: clang + library: static + - os: ubuntu-18.04 + compiler: clang + library: shared + - os: ubuntu-18.04 + compiler: gcc + library: static + cross: i386 + - os: ubuntu-18.04 + compiler: gcc + library: static + cross: aarch64 + - os: ubuntu-18.04 + compiler: gcc + library: shared + cross: aarch64 + + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ env.JOBNAME }}-${{ github.ref }} + restore-keys: | + ${{ env.JOBNAME }}-refs/heads/main + - name: Install packages + run: sudo apt install -y ${{ env.PKGS }} + - name: Install i386 cross compiling packages + if: matrix.config.cross == 'i386' + run: sudo apt install -y gcc-multilib + - name: Install aarch64 cross compiling packages + if: matrix.config.cross == 'aarch64' + run: | + sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross \ + pkg-config-aarch64-linux-gnu + - name: Prepare environment + run: | + .ci/linux-setup.sh + # Workaround on $HOME permissions as EAL checks them for plugin loading + chmod o-w $HOME + - name: Build and test + run: | + export DEF_LIB=${{ matrix.config.library }} + export BUILD_DOCS=1 + case '${{ matrix.config.cross }}' in + 'i386') + export BUILD_32BIT=1 + ;; + 'aarch64') + export AARCH64=1 + ;; + '') + export RUN_TESTS=1 + ;; + esac + .ci/linux-build.sh + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: meson-logs-${{ env.JOBNAME }} + path: | + build/meson-logs/testlog.txt + build/.ninja_log + build/meson-logs/meson-log.txt diff --git a/MAINTAINERS b/MAINTAINERS index 214515060a..95b61085b7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -109,6 +109,7 @@ Public CI M: Aaron Conole M: Michael Santana F: .travis.yml +F: .github/workflows/build.yml F: .ci/ ABI Policy & Versioning