From daeab973424bc78d59d3cee40aa1212a0339f200 Mon Sep 17 00:00:00 2001 From: Silabs-ThieuVu <65759766+Silabs-ThieuVu@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:15:39 +0700 Subject: [PATCH] Silabs thieu vu patch 1 (#32) * Update 03-Run_Integration_Test.yaml * Update 00-Check_Coding_Convention.yaml * Update 01-Generate_Firmware.yaml * Update 01-Generate_Firmware.yaml * Update 02-Run_Unit_Test.yaml * Update 02-Run_Unit_Test.yaml --- .../workflows/00-Check_Coding_Convention.yaml | 30 ++++------ .github/workflows/01-Generate_Firmware.yaml | 60 ++++++++----------- .github/workflows/02-Run_Unit_Test.yaml | 60 ++++++++----------- .../workflows/03-Run_Integration_Test.yaml | 60 ++++++++----------- 4 files changed, 91 insertions(+), 119 deletions(-) diff --git a/.github/workflows/00-Check_Coding_Convention.yaml b/.github/workflows/00-Check_Coding_Convention.yaml index 2116adc..04e419a 100644 --- a/.github/workflows/00-Check_Coding_Convention.yaml +++ b/.github/workflows/00-Check_Coding_Convention.yaml @@ -24,26 +24,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Install python3.11 if: always() run: | diff --git a/.github/workflows/01-Generate_Firmware.yaml b/.github/workflows/01-Generate_Firmware.yaml index bd2511b..9c92ac9 100644 --- a/.github/workflows/01-Generate_Firmware.yaml +++ b/.github/workflows/01-Generate_Firmware.yaml @@ -46,26 +46,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Install Simplicity SDK if: always() run: | @@ -201,26 +197,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Install Simplicity SDK if: always() run: | diff --git a/.github/workflows/02-Run_Unit_Test.yaml b/.github/workflows/02-Run_Unit_Test.yaml index b1892e2..e8e7521 100644 --- a/.github/workflows/02-Run_Unit_Test.yaml +++ b/.github/workflows/02-Run_Unit_Test.yaml @@ -37,26 +37,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Add extension run: | cd $SDK_PATH @@ -126,26 +122,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Add extension run: | cd $SDK_PATH diff --git a/.github/workflows/03-Run_Integration_Test.yaml b/.github/workflows/03-Run_Integration_Test.yaml index 9f937a3..73bc179 100644 --- a/.github/workflows/03-Run_Integration_Test.yaml +++ b/.github/workflows/03-Run_Integration_Test.yaml @@ -37,26 +37,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Add extension run: | cd $SDK_PATH @@ -124,26 +120,22 @@ jobs: steps: - name: Trigger run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - else - echo "Checkout branch ${{ github.event.inputs.branch }}" - fi - else - # Extract branch name from github.ref - BRANCH_NAME="${{ github.ref }}" - BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/' - echo "Checkout branch $BRANCH_NAME" - fi - + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 + fi + fi - name: Checkout - uses: actions/checkout@v4.1.7 - + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + - name: Log Current Branch and Commit + run: | + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" - name: Add extension run: | cd $SDK_PATH