Skip to content

Commit 63b789a

Browse files
Enable Gaudi3, Rocm and Arc on manually release test. (#1615)
1. Enable Gaudi3, Rocm and Arc on manually release test. 2. Fix the issue that manual workflow can't be canceled. Signed-off-by: ZePan110 <ze.pan@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d670dbf commit 63b789a

3 files changed

Lines changed: 47 additions & 6 deletions

File tree

.github/workflows/_example-workflow.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,26 @@ on:
5050
type: boolean
5151

5252
jobs:
53+
pre-build-image-check:
54+
runs-on: ubuntu-latest
55+
outputs:
56+
should_skip: ${{ steps.check-skip.outputs.should_skip }}
57+
steps:
58+
- name: Check if job should be skipped
59+
id: check-skip
60+
run: |
61+
if [[ "${{ inputs.node }}" == "gaudi3" || "${{ inputs.node }}" == "rocm" || "${{ inputs.node }}" == "arc" ]]; then
62+
echo "should_skip=true" >> $GITHUB_OUTPUT
63+
else
64+
echo "should_skip=false" >> $GITHUB_OUTPUT
65+
fi
66+
5367
####################################################################################################
5468
# Image Build
5569
####################################################################################################
5670
build-images:
71+
needs: [pre-build-image-check]
72+
if: ${{ needs.pre-build-image-check.outputs.should_skip == 'false' }}
5773
runs-on: "docker-build-${{ inputs.node }}"
5874
steps:
5975
- name: Clean Up Working Directory
@@ -105,12 +121,33 @@ jobs:
105121
inject_commit: ${{ inputs.inject_commit }}
106122
tag: ${{ inputs.tag }}
107123

124+
pre-compose-test-check:
125+
needs: [pre-build-image-check, build-images]
126+
if: always()
127+
runs-on: ubuntu-latest
128+
outputs:
129+
run_compose: ${{ steps.check-compose.outputs.run_compose }}
130+
steps:
131+
- name: Check if job should be skipped
132+
id: check-compose
133+
run: |
134+
set -x
135+
run_compose="false"
136+
if [[ ${{ inputs.test_compose }} ]]; then
137+
if [[ "${{ needs.pre-build-image-check.outputs.should_skip }}" == "false" && "${{ needs.build-images.result}}" == "success" || "${{ needs.pre-build-image-check.outputs.should_skip }}" == "true" ]]; then
138+
run_compose="true"
139+
fi
140+
fi
141+
echo "run_compose=$run_compose"
142+
echo "run_compose=$run_compose" >> $GITHUB_OUTPUT
143+
144+
108145
####################################################################################################
109146
# Docker Compose Test
110147
####################################################################################################
111148
test-example-compose:
112-
needs: [build-images]
113-
if: ${{ fromJSON(inputs.test_compose) }}
149+
needs: [pre-compose-test-check]
150+
if: ${{ always() && needs.pre-compose-test-check.outputs.run_compose == 'true' }}
114151
uses: ./.github/workflows/_run-docker-compose.yml
115152
with:
116153
tag: ${{ inputs.tag }}

.github/workflows/_run-docker-compose.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@ jobs:
6464
cd ${{ github.workspace }}/${{ inputs.example }}/tests
6565
run_test_cases=""
6666
67-
default_test_case=$(find . -type f -name "test_compose_on_${{ inputs.hardware }}.sh" | cut -d/ -f2)
67+
if [ "${{ inputs.hardware }}" == "gaudi2" ] || [ "${{ inputs.hardware }}" == "gaudi3" ]; then
68+
hardware="gaudi"
69+
else
70+
hardware="${{ inputs.hardware }}"
71+
fi
72+
default_test_case=$(find . -type f -name "test_compose_on_$hardware.sh" | cut -d/ -f2)
6873
if [ "$default_test_case" ]; then run_test_cases="$default_test_case"; fi
69-
other_test_cases=$(find . -type f -name "test_compose_*_on_${{ inputs.hardware }}.sh" | cut -d/ -f2)
74+
other_test_cases=$(find . -type f -name "test_compose_*_on_$hardware.sh" | cut -d/ -f2)
7075
echo "default_test_case=$default_test_case"
7176
echo "other_test_cases=$other_test_cases"
7277

.github/workflows/manual-example-workflow.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
inputs:
88
nodes:
99
default: "gaudi,xeon"
10-
description: "Hardware to run test"
10+
description: "Hardware to run test gaudi,gaudi3,xeon,rocm,arc"
1111
required: true
1212
type: string
1313
examples:
@@ -96,7 +96,6 @@ jobs:
9696

9797
run-examples:
9898
needs: [get-test-matrix] #[get-test-matrix, build-deploy-gmc]
99-
if: always()
10099
strategy:
101100
matrix:
102101
example: ${{ fromJson(needs.get-test-matrix.outputs.examples) }}

0 commit comments

Comments
 (0)