From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.74]) by mx.groups.io with SMTP id smtpd.web10.3090.1686186413804577677 for ; Wed, 07 Jun 2023 18:06:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=eFyPqgVh; spf=pass (domain: ami.com, ip: 40.107.93.74, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZrJdXrBkVP2RwXc/fyiBHdf0ofCZAm3jEpKVh//UFDVZHtp+RunDGGrdXWumjv/YLY8UFF5vqP074BmVvfjmK3TLRKeAIueQxLrEgVi53Bpf6GDKVUb/Nn61QQ0qZ5G9TeztUm9dYDD6vgF6L6q5uve+iyftUPcMOVfPVbvBuHuBGrr5hlBiB/jqskuofA9Iu1ypf6Q0kEilOXYe9zq58lpKDwKbxGFPnpRAUunYflaZ8sF9YWWZQfBlI2A1yTqFQVRdIEFAwM7v8Ff61UZ9SXa8L1jFDybvtyQVUXbTGzampIrWFuItdWJ8Z77NFifOBW9zGh0r1ZUhFC9WGDbzQ== 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=0EslDO66UIqkIJcTPsdkBGwFPjmRe+DW07sIHRTK9v8=; b=MDp4yoM8tou3d5yOQmXgDOAn+KLs8KcXnmpNVTPor4cQqBbMgQyBhgFLl9ZYO/2+NcRBq2Qr6Oi3xLIcFNcp9zErm0eTtGUM7dZgjcceSfTeTBU73QrAbDQEf576/EM+qVK20GvNopd6NbxapM09Cxjaamkvizt+GxzlhVNKuthk/dAccUYxgIPCXZncGYqxmorAT7HiN7tQH9kjZipQPDfPesonzWsw4aUKPmrps/dD4WCOew6JLBx036iTA75hPeAjJI5H/o2//hMfFP0e506TlleU+4T5IKp5zKhNWQuHPp0rUBP3YkSFxgiO7X3Hd6LDiJ2NCD0y4OBo02hONA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ami.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0EslDO66UIqkIJcTPsdkBGwFPjmRe+DW07sIHRTK9v8=; b=eFyPqgVhEzeexQr5EedSBBsl9wdKcxSk8wZDeioHDpcIAnh+9OV9UDxh43rBEOHfe1dia5yj8jzJtvc6r8bJVazYscOEYdMVwKw2yiFoHXL4JNmTeuu4LFNAybYsyG/4Fe41//PUiRp5i8okaPaEjkZXWeVGgyosbpme/S7kCDs= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by PH7PR10MB7732.namprd10.prod.outlook.com (2603:10b6:510:2fe::7) 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 01:06:48 +0000 Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::ea0:65a4:e78d:b722]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::ea0:65a4:e78d:b722%3]) with mapi id 15.20.6455.037; Thu, 8 Jun 2023 01:06:48 +0000 From: "Igor Kulchytskyy" To: "Chang, Abner" , Nickle Wang , "devel@edk2.groups.io" Subject: Re: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add build check and uncrustify check Thread-Topic: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add build check and uncrustify check Thread-Index: AQHZmaAfeGvcZooOeEqlTQTBvUjn2K+AF6z6 Date: Thu, 8 Jun 2023 01:06:48 +0000 Message-ID: References: <20230607161223.15282-1-nicklew@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=True;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-06-08T00:27:44.0000000Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ami.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|PH7PR10MB7732:EE_ x-ms-office365-filtering-correlation-id: dd9a5757-8608-4cf4-f4b2-08db67bca29a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PyXHy0Ot/IJwTlwK+Mu2j3vt4PULaoabV0SRVPyCElI6KmNmK7bS164rBrWMKjTAwL3ZZFSAx902+oprTE6DGpqjO8dZhuSiDcuHD9MjfSFh1gpYx6CYlpUt6rKFmyarTdCVGsocqG+kpCQzkDj4fxOjdK/fFGVoET4Qix0kFLu2KKmHkEUIweyLHhUCXXVmiymOen0OL4YI5GyG7Bm7HDvHAAf7zf+dDypqEpCjEItv71rQz4NMP94zEYtq7ZRBy/ac7q8+6Wl2RsiVm2ZAwk7/Pf3H8heK4leSHY37T1CORlyjzHP9d7E/jNoQ2v+cOTbn9vX2Z4Yae7Djx1HJnV8URI2DsTdmJCrwoAISXzIvfagII+QqPJN0cs8q719z361yC/Nk515zqd15OUoRZk70zPQdqme8jYnYlDCL2PK7ufq2v0n1ZBfafLGgKmT4Abgj/mbmlruQ1ayy7b+vycttRz2divtzQDq6eW39eviSQWGuIM1R7EVN+eueQJrhr2gmyTH2RSpB1d2YI3/YO72S/HmnHt6yA0VQZvUk6jWu0aHUB9WIL/R0RHgEWq6ZUbEmDtRzbeGjXUgIgpDMgAfJWiS3f0oi9q8n9gZlxZI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5185.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(366004)(396003)(39850400004)(136003)(451199021)(2906002)(83380400001)(166002)(40140700001)(86362001)(33656002)(38070700005)(38100700002)(122000001)(84970400001)(55016003)(64756008)(6506007)(41300700001)(52536014)(5660300002)(966005)(7696005)(316002)(186003)(8676002)(8936002)(110136005)(478600001)(66556008)(71200400001)(66946007)(66446008)(76116006)(9686003)(66476007)(53546011)(45080400002)(26005)(91956017);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?trT52M1wy3fntdnj7IV2ZiQVOFPyvuSacV5h9yPlnZQciX7yVCEu6Pywv8F+?= =?us-ascii?Q?2Bhedx3RNAiDCa9YPrxpnFp6eMkWDTsbnsFP3BYxaKbiI7KY3O3LnzNg1R+E?= =?us-ascii?Q?DdF7iDoHE9PIzD9GS0h1KMVyltyOukeONzPwnhH7xuBPo8rHxJKvYAtL1l5t?= =?us-ascii?Q?HL9tnGR9AvK31a+vvP51+7Af0nR6gMTXuK1pu5vNpw6wfz0ndMwoOCwx5F+0?= =?us-ascii?Q?lyVs27VxR70wT3mc/ENyEYJYQkL2njbrMnq7ARbcrq7gVxgeG9tw6TWPtVMt?= =?us-ascii?Q?rJ21ZqoYqr67qXs/mRHFkDu8adp+w+E6xA3BtbR/+0WxFxlq3fUWimnF/lpl?= =?us-ascii?Q?w3HqGyTSp7zogEHQDp4kQBEzxVL9qurXInGc36IQ1GcT1sTCnRvs777FuuhH?= =?us-ascii?Q?cXnUcJpV/O2TqkLhOT+f0IxQ3VXEwpiNe2UNgwwdtsQGDt7e+QubpI/2DeeB?= =?us-ascii?Q?S51dIitJ4VQ7O62e2cYLkspr4v8vg73GcRVbkonzz1OK4tj1dcG/3PngX/Nd?= =?us-ascii?Q?6Om5ETcCC6lB3r5pHD7zIYnKbX4yk3MeVHPuSwSTZrJ8pavIJ09jPJ7oAM0F?= =?us-ascii?Q?nIjxwxrt6Zx59gPJh91SCmHx+JtJ+CNG25oseHychTnPUrjRqbfrkK15bK7D?= =?us-ascii?Q?0gncnCf53+DNetKTblvGk9FwoggvdjYaoUuHX96JNpwLWmCbNbYGMb51qAJs?= =?us-ascii?Q?etuhTtZW7z/5MjuCRtZoRPZVukhHSbk4wfTHx2zNK4bczP+Eu9CBSmr/7hcP?= =?us-ascii?Q?r6wtYaTxker7aB/8/IAzcxw5fgL6/CnsKsDnxHSP7ogBDrKCHDvv0hiIghfQ?= =?us-ascii?Q?36apJcG+RFGWo/IjouF0DjfZ6IU6pieoxklP52RMxMnibE0goWprclgDrXDk?= =?us-ascii?Q?B6G9av+KT99EwV7JIcvgJ/g5p6V1xt+CaeRYld6gSyqC6AxnF7RHkc/msoK8?= =?us-ascii?Q?PX812o282Bb0dv3FhuficFqLSN/Jwa/e8E/5JIiitX8k0TYQggzdo8Wuw3yw?= =?us-ascii?Q?ak2h7CQ1bn8G+jQyK2HpptkUFY02HcuhbbCdTQVutNizQcOKDCDZDvo34/BL?= =?us-ascii?Q?8wnnL37o2GATGU0G0Ed2u7mcyRO3YQutbkndJQDr5RGYx3CHHIbSLpst/1CF?= =?us-ascii?Q?tw7OxsksJKFdj8y79LSOJL3cvtN62EsAR+OacGOMb3nkJdGaWHKVxXistHWf?= =?us-ascii?Q?Kg+eGhQW9PAaPB5JkmF0SW/OWSyxra9j/vRUGwA1ZoLxu37s5Mha5kDxSTvs?= =?us-ascii?Q?aE+qsuEZLMNinuL/visC0edpg8l6MmTlE+iCNay3VWD1dUDwGkcUqeY9Dzpr?= =?us-ascii?Q?6Hv5mMuwq74ePE1AB5mWW8Mh9+XascoRtRfMLN08iOSKZv7EU2BnuVoku0TX?= =?us-ascii?Q?4gPpoYjitrB3fddHw1alu5bqu4kVcKDlaZMDQak4ibm/roN/xF4ufPBJpvot?= =?us-ascii?Q?eOCSnmNxqDFGsuk4zIHvPIvrCvoOuDdICAY8rQzSQK71KjwseFLmcdJOR7nE?= =?us-ascii?Q?EziHYR3c9FbMbcOE9w4a5nMhMisXJ2hboVTYnppPXZJcyxESMaSSbUOpmJcX?= =?us-ascii?Q?Rw+yv8GchvzZHkQXQymSPaA8e+2N3oO85w41YCLO?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5185.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd9a5757-8608-4cf4-f4b2-08db67bca29a X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2023 01:06:48.2222 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: y9tH9Zk+QfkTCYbE2JWy7ZlFbZ0T+KhkXjEXxHoZXIvekP2sS72tafduanVlpf// X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7732 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BLAPR10MB5185435FBD046D38B91EF855A850ABLAPR10MB5185namp_" --_000_BLAPR10MB5185435FBD046D38B91EF855A850ABLAPR10MB5185namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you, Nickle Get Outlook for Android ________________________________ From: Chang, Abner Sent: Wednesday, June 7, 2023 8:28:11 PM To: Nickle Wang ; devel@edk2.groups.io Cc: Igor Kulchytskyy Subject: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg/.gith= ub: add build check and uncrustify check **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** [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://nam12.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.n= asm.us%2Fpub%2Fnasm%2Freleasebuilds%2F&data=3D05%7C01%7Cigork%40ami.com%7Cf= e7c0814e24544d5839a08db67b73fa7%7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%= 7C638217808989823384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2= luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D51RRpRuxeci9go= d2Hs5e%2Fa4S7GdeejhRpofp%2FSpjPS4%3D&reserved=3D0" > + echo "" > + echo "1) wget > https://nam12.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.n= asm.us%2Fpub%2Fnasm%2Freleasebuilds%2F2.15rc12%2Fnasm-&data=3D05%7C01%7Cigo= rk%40ami.com%7Cfe7c0814e24544d5839a08db67b73fa7%7C27e97857e15f486cb58e86c2b= 3040f93%7C1%7C0%7C638217808989823384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj= AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata= =3D0X%2B8JSzM7hjzAvLuE6AG1nf6dLKL4SHknyd%2Bv306N%2BA%3D&reserved=3D0 > 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://nam12.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fproje= ctmu%40dev.azure.com%2Fprojectmu%2FUncrustify%2F_git%2FUncrustify&data=3D05= %7C01%7Cigork%40ami.com%7Cfe7c0814e24544d5839a08db67b73fa7%7C27e97857e15f48= 6cb58e86c2b3040f93%7C1%7C0%7C638217808989823384%7CUnknown%7CTWFpbGZsb3d8eyJ= WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7= C%7C&sdata=3DG3FDWSoOa51omLECnejM1KQltXtVzH3r0YcET%2B0FqJs%3D&reserved=3D0<= 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 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= . --_000_BLAPR10MB5185435FBD046D38B91EF855A850ABLAPR10MB5185namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Thank you, Nickle 

From: Chang, Abner <Abne= r.Chang@amd.com>
Sent: Wednesday, June 7, 2023 8:28:11 PM
To: Nickle Wang <nicklew@nvidia.com>; devel@edk2.groups.io <= ;devel@edk2.groups.io>
Cc: Igor Kulchytskyy <igork@ami.com>
Subject: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPk= g/.github: add build check and uncrustify check
 

**CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.**
[AMD Official Use Only - General]

Nice work Nickle!!

Reviewed-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Thursday, June 8, 2023 12:12 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add bu= ild
> check and uncrustify check
>
> Caution: This message originated from an External Source. Use proper c= aution
> 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 <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> ---
>  .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&quo= t;
> +    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://nam12.= safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.nasm.us%2Fpub%2Fn= asm%2Freleasebuilds%2F&data=3D05%7C01%7Cigork%40ami.com%7Cfe7c0814e2454= 4d5839a08db67b73fa7%7C27e97857e15f486cb58e86c2b3040f93%7C1%7C0%7C6382178089= 89823384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTi= I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D51RRpRuxeci9god2Hs5e%2= Fa4S7GdeejhRpofp%2FSpjPS4%3D&reserved=3D0"
> +  echo ""
> +  echo "1) wget
> = https://nam12.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fwww.nas= m.us%2Fpub%2Fnasm%2Freleasebuilds%2F2.15rc12%2Fnasm-&data=3D05%7C01%7Ci= gork%40ami.com%7Cfe7c0814e24544d5839a08db67b73fa7%7C27e97857e15f486cb58e86c= 2b3040f93%7C1%7C0%7C638217808989823384%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w= LjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&= sdata=3D0X%2B8JSzM7hjzAvLuE6AG1nf6dLKL4SHknyd%2Bv306N%2BA%3D&reserved= =3D0
> 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: fal= se
> +          matrix:
> +            in= clude:
> +           &nb= sp;  - Target: "DEBUG"
> +           &nb= sp;    ArchList: "X64"
> +           &nb= sp;    ToolChain: "GCC5"
> +           &nb= sp;  - Target: "RELEASE"
> +           &nb= sp;    ArchList: "X64"
> +           &nb= sp;    ToolChain: "GCC5"
> +           &nb= sp;  - Target: "NOOPT"
> +           &nb= sp;    ArchList: "X64"
> +           &nb= sp;    ToolChain: "GCC5"
> +    runs-on: ubuntu-latest
> +    container:
> +      image: ghcr.io/tianocore/containers/ub= untu-22-dev:latest
> +      options: --user root -v ${{ github.wor= kspace }}:/home/edk2
> +      env:
> +        EDK2_DOCKER_USER_HOME: &qu= ot;/home/edk2"
> +    name: edk2 build test
> +    steps:
> +      - name: checkout edk2
> +        uses: actions/checkout@v3<= br> > +        with:
> +          repository: ti= anocore/edk2
> +          path: ./edk2 > +          submodules: re= cursive
> +      - name: checkout edk2-redfish-client > +        uses: actions/checkout@v3<= br> > +        with:
> +          path: ./edk2-r= edfish-client
> +      - name: edk2 build
> +        run: |
> +          ./edk2-redfish= -client/.github/workflows/build.sh ./edk2 ./edk2-
> redfish-client ${{ matrix.ArchList }} ${{ matrix.Target }} ${{ matrix.= ToolChain }}
> +        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 t= o 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<= br> > +        with:
> +          repository: ti= anocore/edk2
> +          path: ./edk2 > +      - name: checkout edk2-redfish-client > +        uses: actions/checkout@v3<= br> > +        with:
> +          path: ./edk2-r= edfish-client
> +          ref: ${{ githu= b.event.pull_request.head.sha }}
> +          fetch-depth: 0=
> +      - name: uncrustify setup
> +        run: |
> +          git clone
> https://nam12.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fproject= mu%40dev.azure.com%2Fprojectmu%2FUncrustify%2F_git%2FUncrustify&data=3D= 05%7C01%7Cigork%40ami.com%7Cfe7c0814e24544d5839a08db67b73fa7%7C27e97857e15f= 486cb58e86c2b3040f93%7C1%7C0%7C638217808989823384%7CUnknown%7CTWFpbGZsb3d8e= yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C= %7C%7C&sdata=3DG3FDWSoOa51omLECnejM1KQltXtVzH3r0YcET%2B0FqJs%3D&res= erved=3D0
> uncrustify-edk2
> +          cd uncrustify-= edk2
> +          mkdir build > +          cd build
> +          cmake ..
> +          cmake --build = .
> +          cp uncrustify = /usr/local/bin && chmod +x /usr/local/bin/uncrustify
> +      - name: uncrustify check changed files=
> +        run: ./edk2-redfish-client= /.github/workflows/uncrustify-
> check.sh ./edk2/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg ./edk2-<= br> > redfish-client ${{ github.event.pull_request.commits }}
> +        shell: bash
> --
> 2.17.1

-The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are on notice that any distribution of = this message, in any form, is strictly prohibited. Please promptly notify t= he sender by reply e-mail or by telephone at 770-246-8600, and then delete = or destroy all copies of the transmission. --_000_BLAPR10MB5185435FBD046D38B91EF855A850ABLAPR10MB5185namp_--