From patchwork Fri Mar 12 16:35:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1452210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dxryh0QSWz9sPf for ; Sat, 13 Mar 2021 03:35:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E0A8383FFB; Fri, 12 Mar 2021 16:35:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ee9Kh4gJRR4b; Fri, 12 Mar 2021 16:35:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTP id 0089183C12; Fri, 12 Mar 2021 16:35:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DA175C000A; Fri, 12 Mar 2021 16:35:17 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 14BFDC0001 for ; Fri, 12 Mar 2021 16:35:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EAEED43030 for ; Fri, 12 Mar 2021 16:35:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CK2LMxSq9DcA for ; Fri, 12 Mar 2021 16:35:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp2.osuosl.org (Postfix) with ESMTPS id DBB5E43050 for ; Fri, 12 Mar 2021 16:35:15 +0000 (UTC) X-Originating-IP: 78.45.89.65 Received: from im-t490s.redhat.com (ip-78-45-89-65.net.upcbroadband.cz [78.45.89.65]) (Authenticated sender: i.maximets@ovn.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id B8E7720004; Fri, 12 Mar 2021 16:35:11 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 12 Mar 2021 17:35:09 +0100 Message-Id: <20210312163509.2578837-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Cc: Ilya Maximets , Dumitru Ceara Subject: [ovs-dev] [PATCH ovn] ci: Fix handling of python packages. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" GitHub Actions doesn't have python locations in PATH and different runners might have different configuration for default python location and versions. For example, on some runners python2 might be installed or not. Missing PATH causes weird situations where during one run our scripts can locate just installed flake8 and can't do that on a different run. Also, we're mistakenly installing python2 version of flake8. On runners that able to locate installed flake8 this causes breakage of a flake8-check build target because our python scripts written for python3. And runners that can't locate flake8 works just fine and job succeeds. It's required to use actions/setup-python@v2 in order to have predictable version of python installed and paths correctly configured. Due to some bugs in GHA itself it doesn't set $HOME/.local/bin into PATH, so we have to do that manually for now in order to use '--user'. Fixes: ecdd790ecbff ("CI: Add github actions workflow.") Reported-by: Numan Siddique Signed-off-by: Ilya Maximets --- Will also work on similar patch for OVS. .ci/linux-prepare.sh | 4 ++-- .github/workflows/test.yml | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.ci/linux-prepare.sh b/.ci/linux-prepare.sh index 0bb0ff096..55f419b63 100755 --- a/.ci/linux-prepare.sh +++ b/.ci/linux-prepare.sh @@ -12,5 +12,5 @@ set -ev git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git cd sparse && make -j4 HAVE_LLVM= HAVE_SQLITE= install && cd .. -pip install --disable-pip-version-check --user six flake8 hacking -pip install --user --upgrade docutils +pip3 install --disable-pip-version-check --user six flake8 hacking +pip3 install --upgrade --user docutils diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26a8edb8f..251672748 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,11 +97,21 @@ jobs: if: matrix.m32 != '' run: sudo apt install -y ${{ env.m32_dependecies }} + - name: update PATH + run: | + echo "$HOME/bin" >> $GITHUB_PATH + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: set up python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: prepare run: ./.ci/linux-prepare.sh - name: build - run: PATH="$PATH:$HOME/bin" ./.ci/linux-build.sh + run: ./.ci/linux-build.sh - name: copy logs on failure if: failure() || cancelled() @@ -154,10 +164,18 @@ jobs: ref: 'master' - name: install dependencies run: brew install automake libtool + - name: update PATH + run: | + echo "$HOME/bin" >> $GITHUB_PATH + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: set up python + uses: actions/setup-python@v2 + with: + python-version: '3.x' - name: prepare run: ./.ci/osx-prepare.sh - name: build - run: PATH="$PATH:$HOME/bin" ./.ci/osx-build.sh + run: ./.ci/osx-build.sh - name: upload logs on failure if: failure() uses: actions/upload-artifact@v2