public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Igor Kulchytskyy" <igork@ami.com>
To: Nickle Wang <nicklew@nvidia.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>
Subject: Re: [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add patch check
Date: Mon, 12 Jun 2023 16:19:51 +0000	[thread overview]
Message-ID: <BLAPR10MB5185B672F43FCA4C9883C902A854A@BLAPR10MB5185.namprd10.prod.outlook.com> (raw)
In-Reply-To: <20230612151520.11496-1-nicklew@nvidia.com>

Reviewed-by: Igor Kulchytskyy <igork@ami.com>

-----Original Message-----
From: Nickle Wang <nicklew@nvidia.com>
Sent: Monday, June 12, 2023 11:15 AM
To: devel@edk2.groups.io
Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [EXTERNAL] [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add patch check


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

- Run /BaseTools/Scripts/PatchCheck.py to check changes
on pull request.
- Create main.yml to handle push check on main branch.
And show the status of RedfishClientPkg on README.md

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
 .github/workflows/build.yml       |  3 --
 .github/workflows/main.yml        | 58 +++++++++++++++++++++++++++++++
 .github/workflows/patch-check.sh  | 47 +++++++++++++++++++++++++
 .github/workflows/patch-check.yml | 39 +++++++++++++++++++++
 README.md                         |  3 ++
 5 files changed, 147 insertions(+), 3 deletions(-)
 create mode 100644 .github/workflows/main.yml
 create mode 100755 .github/workflows/patch-check.sh
 create mode 100644 .github/workflows/patch-check.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f44184b3..e5a61992 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,9 +7,6 @@
 ##
 name: "RedfishClientPkg Build"
 on:
-  push:
-    branches:
-      - main
   pull_request:
     branches:
       - main
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 00000000..4bfd5e8f
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,58 @@
+# @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
+    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.ToolChain }}
+        shell: bash
+
diff --git a/.github/workflows/patch-check.sh b/.github/workflows/patch-check.sh
new file mode 100755
index 00000000..8cc63bd5
--- /dev/null
+++ b/.github/workflows/patch-check.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+#
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+
+if [ $# -ne 2 ]
+then
+    echo "usage: $0 [PATH to PATCH-SET] [PATH to EDK2 REPO.]"
+    exit 1
+fi
+
+PATCH_FOLDER="$PWD/$1"
+REPO_PATH="$PWD/$2"
+FAILURE=0
+
+if [ ! -e "$PATCH_FOLDER" ]
+then
+    echo "$PATCH_FOLDER does not exist"
+    exit 1
+fi
+
+if [ ! -e "$REPO_PATH" ]
+then
+    echo "$REPO_PATH does not exist"
+    exit 1
+fi
+
+for file in `ls $PATCH_FOLDER/*.patch`
+do
+  echo "Check patch: $file"
+  python3 $REPO_PATH/BaseTools/Scripts/PatchCheck.py $file
+  if [ $? -ne 0 ]
+  then
+    echo "Patch check failure on file: $file"
+    FAILURE=1
+  fi
+done
+
+if [ $FAILURE -eq 0 ]
+then
+  exit 0
+fi
+
+exit 1
diff --git a/.github/workflows/patch-check.yml b/.github/workflows/patch-check.yml
new file mode 100644
index 00000000..2fdef679
--- /dev/null
+++ b/.github/workflows/patch-check.yml
@@ -0,0 +1,39 @@
+# @file
+# GitHub Workflow for patch check
+#
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+name: "Patch check"
+on:
+  pull_request:
+    branches:
+      - main
+
+jobs:
+  patch-check:
+    runs-on: ubuntu-latest
+    name: EDK2 Patch 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: generate format patch
+        run: |
+          mkdir format-patch
+          cd edk2-redfish-client
+          git format-patch --subject-prefix="edk2-redfish-client][PATCH" -${{ github.event.pull_request.commits }} HEAD -O ../edk2/BaseTools/Conf/diff.order -o ../format-patch/
+          ls ../format-patch/
+      - name: run PatchCheck.py
+        run: |
+          ./edk2-redfish-client/.github/workflows/patch-check.sh ./format-patch/ ./edk2/
+        shell: bash
diff --git a/README.md b/README.md
index 478f319b..0babe593 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,9 @@ and provides the functionality to support Redfish service hosted by Board Manage
 Please check [Readme.md](https://github.com/tianocore/edk2/blob/master/RedfishPkg/Readme.md) for the design of
 UEFI Redfish EDK2 implementation.

+# Status
+[![RedfishClientPkg Build](https://github.com/tianocore/edk2-redfish-client/actions/workflows/main.yml/badge.svg)](https://github.com/tianocore/edk2-redfish-client/actions/workflows/main.yml)
+
 # License
 The majority of the content in the EDK Redfish Client open source project uses a
 [BSD-2-Clause Plus Patent License](LICENSE). The EDKII Redfish client open source project contains the following
--
2.17.1

-The information contained in this message may be confidential and proprietary 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 designee. 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 the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

      parent reply	other threads:[~2023-06-12 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 15:15 [edk2-redfish-client][PATCH] RedfishClientPkg/.github: add patch check Nickle Wang
2023-06-12 15:51 ` Chang, Abner
2023-06-12 16:19 ` Igor Kulchytskyy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLAPR10MB5185B672F43FCA4C9883C902A854A@BLAPR10MB5185.namprd10.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox