Skip to content

Commit

Permalink
Update 02-Run_Unit_Test.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Silabs-ThieuVu authored Oct 16, 2024
1 parent 13b8019 commit 094d5e9
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/02-Run_Unit_Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,23 @@ jobs:

- name: Check Branch Input
run: |
if [ -z "${{ github.event.inputs.branch }}" ]; then
echo "Branch input is required."
exit 1
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
echo "Checkout branch ${{ github.event.inputs.branch }}"
- name: Checkout
uses: actions/[email protected]
with:
ref: "${{ github.event.inputs.branch }}"

uses: actions/[email protected]

- name: Add extension
run: |
cd $SDK_PATH
Expand Down Expand Up @@ -123,17 +129,23 @@ jobs:

- name: Check Branch Input
run: |
if [ -z "${{ github.event.inputs.branch }}" ]; then
echo "Branch input is required."
exit 1
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
echo "Checkout branch ${{ github.event.inputs.branch }}"
- name: Checkout
uses: actions/[email protected]
with:
ref: "${{ github.event.inputs.branch }}"

uses: actions/[email protected]

- name: Add extension
run: |
cd $SDK_PATH
Expand Down

0 comments on commit 094d5e9

Please sign in to comment.