From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.81]) by mx.groups.io with SMTP id smtpd.web11.2381.1686184093955761374 for ; Wed, 07 Jun 2023 17:28:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=hibRqsq4; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.220.81, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F36ji560Ez8OACbejinsXSveAaexssnsX9GebKHJaxcBwfMXg1SCkrkI70bxWB/FZkS3D1fa8rQxrp4DjmW2bgTAqI/0WdSLMeY/x8PSlNV6d6K1ONea3MFGauOrGY0FumclNuuRvSGmqDPcra5Naeg0VMSw/A627eRvcX9vCPSkeNu4uVURiTb54w16tAo7g/P4eXwyLUpusLkqgKij4Hz4LjokOaY4qdmw6jW9V0Zh0Wq4Lw9H+NtU6++8w7JQh7QosgSYTVD87a2uAHgOSI8bB9i3ALYDjIA2DUjEyO7Fz2WulhP8lkOUUejRvHwOOEo0OBjA3ZNkRDF5XJoxCg== 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=ntL08H+aXcpjNJgPSgRL1Vq3RDdL2+dN6PreR4yAfyA=; b=oC/hrQXGvZPwcQ0IhYD/kWq9X48w6Nefi6p7lBfyojodSJXqwFWDrq3m6Ze0xV1tBvB3JflwrAviz0lbSZbHOnz8+UlF03GmdlQSkNkESgCoYFg7qQYKkqk2s8erlCS22cWhzfSeet5epWNkdHhNRdCVCRKhivleZZwh6zsfp+tv+K1zS9itDL0yqfU4IbYnOHkGrynbOkmAVjWCL3kQYE8pYA84LhA+gNqIZkkCh94fWmjIv+A7NOZUvKCQogDVozr+I9igHWc9Y6ECsQbJhbtzSc8FKl+HtyhjRMB5Ono06QmWZmMSrkNfQY24slMpUgqQAT/uwt+TGMPU+rg+/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ntL08H+aXcpjNJgPSgRL1Vq3RDdL2+dN6PreR4yAfyA=; b=hibRqsq4WEmA5/MaIxDAlQIsPHQ4JSdIPWvjEqtKpaz8aHtv/EOZWHEXJFdeSi3yunJJxQoSMkZy11ooN+zl5ilrMIjIYAW733p/A/w68haUDQj87x90mZwl1vykt5nvmWmAKAfrH5yG21dgcyNZ36SjXxLgEWuNHqwrv1x40kY= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by PH8PR12MB7424.namprd12.prod.outlook.com (2603:10b6:510:228::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 00:28:11 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040%6]) with mapi id 15.20.6455.037; Thu, 8 Jun 2023 00:28:11 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add build check and uncrustify check Thread-Topic: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add build check and uncrustify check Thread-Index: AQHZmVsUwaKt5eF0hkO7VFvfSB60+6+ADWBA Date: Thu, 8 Jun 2023 00:28:11 +0000 Message-ID: References: <20230607161223.15282-1-nicklew@nvidia.com> In-Reply-To: <20230607161223.15282-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=8e596f49-54a9-4c12-860e-36a037eb10f5;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-06-08T00:27:44Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|PH8PR12MB7424:EE_ x-ms-office365-filtering-correlation-id: ff21809f-f843-4625-1742-08db67b73d77 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lI8+OJS4N29pRyos9ghEoFlzVe3inEZlYq8EPUBu8lH7tMcRD4dgVOSaxJh9SOCd89kvEPK9jVhcq6RKE2uTbwnO2+Knz+9JzqIVoFD2URJfxnDoci39qucngCha56svBXBmE+DcMcyZUNqSUrMQOzlgzKTInFgtn22nz1HWfJxawOkfIXKC2GEwwbEZnqhRz1KLZmaEF7hj0FiKXWvIh3CXOq7Eh1KOwT4o/6Ro8bBj3crkHeAqiHM+tppD8W8L9Y8XsKrOHmFllJZOaO7ycCwMXHlx5Bv2llvWSgyWXU01aFGN0252js4WYheYP6b7TChydnHAJ2OBs+s6MB4rIoxL3r1gh5ScnT3HZA6BeSWPEboySL04xdTdDLjT1KcoQjXH0ihrzj1C9SdqbtjjuWhoFXO1XczkwsMgNHKNbZidD4U4ecbvqSTZJwB8bTH2XBZcUpI12sAi+v5DHE+Ol9yaELOSSuIPOx0tLSFFZkcgaK8K5y4ppCWD1SmfxKHHWwQ1NArkAcaXLkFQIjmRz4duwD9JNiQ8lYYuET8q5/fJssAzpnojfXyX2pQnmAwTCg70EcpETdJh0yN+Al3SzX5lOzfb6kz/Q6t7SFBScFx3WEBc062lqX9UoDyxN53bLJulNj9O6MNrO3W8nm+HBg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(366004)(451199021)(7696005)(966005)(38070700005)(71200400001)(9686003)(26005)(55016003)(53546011)(83380400001)(6506007)(33656002)(186003)(86362001)(38100700002)(122000001)(84970400001)(110136005)(5660300002)(52536014)(316002)(41300700001)(8676002)(8936002)(66446008)(64756008)(66476007)(4326008)(66556008)(478600001)(66946007)(76116006)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?E1GmQ5kz/noFo0AiRDMpy/shGEldIeC624BI40CUmZHIs2dxp1nJoIReuvFT?= =?us-ascii?Q?YweTn6coZTQkTt0RNXdPb/nftvCG/4Sl2/JboS8ej6qRdALhI6r4EUU54n6F?= =?us-ascii?Q?LZuJNv0c7HmyUjCxugFSExsxnUT2OnPnfgqoQr64ygJ0EwJcKXxo53iam0Me?= =?us-ascii?Q?8mjAe75A3NOzr7DVQlE+N6Nnuz1HIF589QduA++cVOfChTjmIgUUErgnOWV9?= =?us-ascii?Q?hMQ72aZjKRTL7lNUtPLmyWSueB4TISR5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neDxPXMckifFuLVIvwoPiI9yY12b1X7CXGTFEY1CsRgig?= =?us-ascii?Q?CWGOIJdS4h9lkpEr3NmQUTzMqGKk4Q3beSxxoZh/bVBgz0orxmcu5/Y7V9ek?= =?us-ascii?Q?gUZaGHDZRRlOwq78rC6/t0WNndhslcO4LmYabFkrWZVPND725yeKZsFBwsdP?= =?us-ascii?Q?zn41VMWa3v61Q5aIa3K8GGVURQsHxbwuuqVv7j7zMaBq5sBSdJkk5HSAYTqS?= =?us-ascii?Q?DwDNOjrxa3ttoaAzpMzU/aApAqhlLNPJ7DjZzoOQPn5SDz8602USyQY8UaW5?= =?us-ascii?Q?2HmSlIbVrMZB6M6SfzIQh3rffuBLkyrNkNQwZFRrPJ7KO32h8dd2TbHe42B6?= =?us-ascii?Q?ivp570BJA+G5bC0KjySIi/fPCoebHoEkg1jB90aQoWtprW3qM0FsT5iI/OIm?= =?us-ascii?Q?CdCMbzMu1Qq355PGdX0bzx4CZ6xavFsdc88mdTq7?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff21809f-f843-4625-1742-08db67b73d77 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2023 00:28:11.0643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0yOaaP+TADOwJLmc+LI7aQuhT807V0gtTP0QTS23QF2A5FH/5Wtncboc84XbgFKHpr+t8d0Pmi0UTIV7UGhW+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7424 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Nice work Nickle!! Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Thursday, June 8, 2023 12:12 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > > Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add build > check and uncrustify check > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > 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 > --- > .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] > [TARGET] [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 = from: > 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/workflows/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= - > redfish-client ${{ matrix.ArchList }} ${{ matrix.Target }} ${{ matrix.Too= lChain }} > + shell: bash > + > diff --git a/.github/.github/workflows/uncrustify-check.sh > b/.github/.github/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/workflows/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/uncrus= tify > + - 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 > -- > 2.17.1