From nobody Fri May 17 06:07:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105870+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1686154364016996.6838896848151; Wed, 7 Jun 2023 09:12:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8E01YY1788612x5WD6H232If; Wed, 07 Jun 2023 09:12:43 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.84]) by mx.groups.io with SMTP id smtpd.web10.2309.1686154362872204459 for ; Wed, 07 Jun 2023 09:12:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XFy5q5FDA8WTvmgtIvJFXo6lGMUAlutH15SyYLsUU3gmdPxGDqcn/EVZl65dN5ux+tC3wCJ9wZ9VSyzBSXaGVNKyW2jdkFhREzXhJLjuXT6+QBkQCVTC1+z5eJ2VFIW3fmjOnfWP0uWHBa2u67Aus1SDZE6Wq7i3fhq/o5ASwG/KhVjmuMje+Ukt8Ue33szFRmHQNu1QY3FPX+pyAVi7hA37MA9rxKBGcW0iiBhmKlG5dW+1yVb0bfYF96onbdLRVxC+aUcHnq0/QbmUP/A76xapy/QACCRsSk1cAQA9k9sGJzdoofzd9zhUOspQv6F/vl2j7Pd5Ca+SyiFwElNeIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BFW2ESLkFwvkTcXZEQl4v0ngt79uAxI+1+a/g/toRFs=; b=mb2D0FIH9bKSq5jlPYvEkulFyGsPO5jpiAqyrUBeXQ4F5NGw1mdYY9a5y01pJ272c0Jx4teShO9UVjNJsscdMGlcO7a/1HF/dbzdlNrF1hN7Z779guXRZ4sNmAuHhBTuExAFZUpSgBC6gyTBHh/5NA7Vu2qBZAFffe86VrK7h0lIN2sVMFzZ7xar62Ko35Po4z34WSxx35wGNMDhnI3fKBkWi5n6fVIEd3/ZJEFFVU0lkD/SZtkLjX/4HgAN0k+99s7hR9Z/u7sb05lIqjVpqmCIj5TNOwXV+b+fSkClDu+NTcBxXZ6PVocHyAQkWyc04vJarmCUWSQdYxAumw6vZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from MW3PR05CA0006.namprd05.prod.outlook.com (2603:10b6:303:2b::11) by PH7PR12MB8827.namprd12.prod.outlook.com (2603:10b6:510:26b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Wed, 7 Jun 2023 16:12:40 +0000 X-Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2b:cafe::8) by MW3PR05CA0006.outlook.office365.com (2603:10b6:303:2b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Wed, 7 Jun 2023 16:12:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105870+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.36 via Frontend Transport; Wed, 7 Jun 2023 16:12:39 +0000 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 7 Jun 2023 09:12:28 -0700 X-Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 7 Jun 2023 09:12:27 -0700 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.11) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Wed, 7 Jun 2023 09:12:24 -0700 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy Subject: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add build check and uncrustify check Date: Thu, 8 Jun 2023 00:12:23 +0800 Message-ID: <20230607161223.15282-1-nicklew@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT036:EE_|PH7PR12MB8827:EE_ X-MS-Office365-Filtering-Correlation-Id: 345a872d-feea-4b8a-f786-08db6772045e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: uxOpXVi0SFVGpe/a1quIR7MdyPVnxZuYZUbR7LD0zDgwIDCD1vMIeDI2FELS6y87rKRJim7Ji9k4qXFVVYqYh4PCLSCJmfQK/JX1TnNKpZmS1Y1cal3DvYDktEWQusWGChX7SfgmJpFAQBCmWNs9YGbJhdyPYxOHkiBz5by93ADJ7nqiiCzKXMCbi3f+9BxYluXVu8Ggu7MZ1vJXDlI5nF8XcofQv7GatqD8nsxsY0GalPim8X2j3WfDgP/nhR1LpwqdkSf0o4NEcM4E0tzsx0Bq3dwf58e86zFl8yCs0NrYz0w3KhJhgphpZ+YGieDJFkv6swD1rn3fLVzAGpE3T2OR1US4KeywgT25ZkV5w9xcYAj+s6i3dO+10T5E2sEksuUZsFpo0DHmG+wcsBLacknfJ4x1x7du3sOwjkZLoIsKXs7NDBgu6BtmYyRrPytaZf6ptMpD3fyy/B1Lic8aN4y00GLwedJIGVqs2OvxIn1lKwWd9OP8KeZrU6ihsOxPQ9N1Tv2UfcOatSqZ7IVHpYltjHh19ZI27JV/75U4jjYej5ZOSqDPHxy6TmY685zvESzWkdpjCnS0bfcrgqBOjSk/8Ke7uBHSwPYnoJEO86lucjICr1GhXqu458Y7oDQTNg8uNjF83xeJOpRiDtk8aEEhvqv2CDpgHgMbr9MMdcPh7rJfYCVhpK4mVWQMmFXIV+JF6Tho1K47og0P+BFXKK2xMvLXUlqdARl4B5rAplXfKcoFqv0XtBOWI5Mp+tIPAnifPLNyBF1xkV77MVMDFTRFHpSpO9yvyg3O8QHBA2Y= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2023 16:12:39.9385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 345a872d-feea-4b8a-f786-08db6772045e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8827 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nicklew@nvidia.com X-Gm-Message-State: hWlgzhNEdKaZ4fZjyQjPdSkBx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1686154363; bh=GOJxuVynYJlOX2yQ+V2JhS8c0b3mz58uZbNqTdmiu6o=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=v0dL91LZ5smZq+0Cbfkan7Oh/dIYZmp2BDMB5knGZwk23q4LwIDaa7TlBKhB5k86TBK 7eO93t7ideQcOkScvn9SduefSQ59gy8UsrHZzknuVkbISjiLUvr+ONqlIe3hQk/1JNw7f uij9cQ6mW9X6g7vVZoBFOnnXDL0NAqVaCN8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1686154365775100001 Content-Type: text/plain; charset="utf-8" Enable Github Actions to check below items: - RedfishClientPkg build check on push and pull request - Uncrustify check on pull request Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Reviewed-by: Abner Chang --- .github/.github/workflows/build.sh | 70 +++++++++++++++++++ .github/.github/workflows/build.yml | 61 ++++++++++++++++ .github/.github/workflows/uncrustify-check.sh | 51 ++++++++++++++ .github/.github/workflows/uncrustify.yml | 44 ++++++++++++ 4 files changed, 226 insertions(+) create mode 100755 .github/.github/workflows/build.sh create mode 100644 .github/.github/workflows/build.yml create mode 100755 .github/.github/workflows/uncrustify-check.sh create mode 100644 .github/.github/workflows/uncrustify.yml diff --git a/.github/.github/workflows/build.sh b/.github/.github/workflows= /build.sh new file mode 100755 index 00000000..f919d551 --- /dev/null +++ b/.github/.github/workflows/build.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + + +ARCH=3D"X64" +TARGET=3D"DEBUG" +TOOLCHAIN=3D"GCC5" + +if [ $# -eq 0 ] +then + echo "usage: $0 [path to edk2] [path to edk2-redfish-client] [ARCH] [T= ARGET] [TOOLCHAIN]" + exit 1 +fi + +EDK2_ROOT=3D"$PWD/$1" +EDK2_REDFISH_CLIENT=3D"$PWD/$2" +ARCH=3D"$3" +TARGET=3D"$4" +TOOLCHAIN=3D"$5" + +if [ ! -e "$EDK2_ROOT" ] +then + echo "$EDK2_ROOT does not exist" + exit 1 +fi + +if [ ! -e "$EDK2_REDFISH_CLIENT" ] +then + echo "$EDK2_REDFISH_CLIENT does not exist" + exit 1 +fi + +export PACKAGES_PATH=3D"$EDK2_ROOT:$EDK2_REDFISH_CLIENT" +echo "PACKAGES_PATH: $PACKAGES_PATH" +echo "ARCH: $ARCH" +echo "TARGET: $TARGET" +echo "TOOLCHAIN: $TOOLCHAIN" + +cd "$EDK2_ROOT" +. edksetup.sh BaseTools + +if [ ! -e "BaseTools/Source/C/bin" ] +then + echo "binary does not exist, rebuild it" + + cd BaseTools + make + cd .. + + echo "If there is build error related to nasm, try to use latest nasm fr= om: https://www.nasm.us/pub/nasm/releasebuilds/" + echo "" + echo "1) wget https://www.nasm.us/pub/nasm/releasebuilds/2.15rc12/nasm-2= .15rc12.tar.gz" + echo "2) tar zxvf nasm-2.15rc12.tar.gz" + echo "3) cd nasm-2.15rc12" + echo "4) ./configure --prefix=3D/usr" + echo "5) sudo make install" + echo "6) nasm -v" +fi + +build -p RedfishClientPkg/RedfishClientPkg.dsc -a $ARCH -t $TOOLCHAIN -b $= TARGET +if [ $? -ne 0 ] +then + exit 1 +fi + +exit 0 diff --git a/.github/.github/workflows/build.yml b/.github/.github/workflow= s/build.yml new file mode 100644 index 00000000..f44184b3 --- /dev/null +++ b/.github/.github/workflows/build.yml @@ -0,0 +1,61 @@ +# @file +# GitHub Workflow for build checks +# +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## +name: "RedfishClientPkg Build" +on: + push: + branches: + - main + pull_request: + branches: + - main + paths-ignore: + - '**/*.bat' + - '**/*.md' + - '**/*.py' + - '**/*.rst' + - '**/*.sh' + - '**/*.txt' + +jobs: + edk2-redfish-client-build: + strategy: + fail-fast: false + matrix: + include: + - Target: "DEBUG" + ArchList: "X64" + ToolChain: "GCC5" + - Target: "RELEASE" + ArchList: "X64" + ToolChain: "GCC5" + - Target: "NOOPT" + ArchList: "X64" + ToolChain: "GCC5" + runs-on: ubuntu-latest + container: + image: ghcr.io/tianocore/containers/ubuntu-22-dev:latest + options: --user root -v ${{ github.workspace }}:/home/edk2 + env: + EDK2_DOCKER_USER_HOME: "/home/edk2" + name: edk2 build test + steps: + - name: checkout edk2 + uses: actions/checkout@v3 + with: + repository: tianocore/edk2 + path: ./edk2 + submodules: recursive + - name: checkout edk2-redfish-client + uses: actions/checkout@v3 + with: + path: ./edk2-redfish-client + - name: edk2 build + run: | + ./edk2-redfish-client/.github/workflows/build.sh ./edk2 ./edk2-r= edfish-client ${{ matrix.ArchList }} ${{ matrix.Target }} ${{ matrix.ToolCh= ain }} + shell: bash + diff --git a/.github/.github/workflows/uncrustify-check.sh b/.github/.githu= b/workflows/uncrustify-check.sh new file mode 100755 index 00000000..b739a60b --- /dev/null +++ b/.github/.github/workflows/uncrustify-check.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + + +if [ $# -ne 3 ] +then + echo "usage: $0 [PATH to CONFIG FILE] [PATH to REPO.] [NO. of COMMITS]" + exit 1 +fi + +CONFIG_FILE=3D"$PWD/$1" +REPO_PATH=3D"$PWD/$2" +NO_COMMITS=3D"$3" + +if [ ! -e "$CONFIG_FILE" ] +then + echo "$CONFIG_FILE does not exist" + exit 1 +fi + +if [ ! -e "$REPO_PATH" ] +then + echo "$REPO_PATH does not exist" + exit 1 +fi + +cd "$REPO_PATH" + +FAILURE=3D0 +CHANGED_FILES=3D$(git diff --name-only HEAD~$NO_COMMITS) +for file in $CHANGED_FILES +do + echo "Uncrustify check file: $file" + uncrustify -c $CONFIG_FILE -f $file --check + if [ $? -ne 0 ] + then + echo "Uncrustify check failure on file: $file" + FAILURE=3D1 + fi +done + +if [ $FAILURE -eq 0 ] +then + exit 0 +fi + +exit 1 diff --git a/.github/.github/workflows/uncrustify.yml b/.github/.github/wor= kflows/uncrustify.yml new file mode 100644 index 00000000..aa603c8d --- /dev/null +++ b/.github/.github/workflows/uncrustify.yml @@ -0,0 +1,44 @@ +# @file +# GitHub Workflow for uncrustify check +# +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## +name: "Uncrustify check" +on: + pull_request: + branches: + - main + paths: + - '**/*.h' + - '**/*.c' + +jobs: + uncrustify-check: + runs-on: ubuntu-latest + name: Uncrustify check + steps: + - name: checkout edk2 + uses: actions/checkout@v3 + with: + repository: tianocore/edk2 + path: ./edk2 + - name: checkout edk2-redfish-client + uses: actions/checkout@v3 + with: + path: ./edk2-redfish-client + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - name: uncrustify setup + run: | + git clone https://projectmu@dev.azure.com/projectmu/Uncrustify/_= git/Uncrustify uncrustify-edk2 + cd uncrustify-edk2 + mkdir build + cd build + cmake .. + cmake --build . + cp uncrustify /usr/local/bin && chmod +x /usr/local/bin/uncrusti= fy + - name: uncrustify check changed files + run: ./edk2-redfish-client/.github/workflows/uncrustify-check.sh .= /edk2/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg ./edk2-redfish-client $= {{ github.event.pull_request.commits }} + shell: bash --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105870): https://edk2.groups.io/g/devel/message/105870 Mute This Topic: https://groups.io/mt/99388066/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-