Skip to content

Commit a222d1c

Browse files
authored
Optimize the nightly/weekly example test (opea-project#1806)
Signed-off-by: chensuyue <[email protected]>
1 parent 1852e6b commit a222d1c

File tree

2 files changed

+76
-7
lines changed

2 files changed

+76
-7
lines changed

.github/workflows/nightly-docker-build-publish.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Nightly build/publish latest docker images
55

66
on:
77
schedule:
8-
- cron: "30 14 * * *" # UTC time
8+
- cron: "30 14 * * 1-5" # UTC time
99
workflow_dispatch:
1010

1111
env:
@@ -38,30 +38,44 @@ jobs:
3838
with:
3939
node: gaudi
4040

41-
build-and-test:
42-
needs: get-build-matrix
41+
build-images:
42+
needs: [get-build-matrix, build-comps-base]
43+
strategy:
44+
matrix:
45+
example: ${{ fromJSON(needs.get-build-matrix.outputs.examples_json) }}
46+
fail-fast: false
47+
uses: ./.github/workflows/_build_image.yml
48+
with:
49+
node: gaudi
50+
example: ${{ matrix.example }}
51+
inject_commit: true
52+
secrets: inherit
53+
54+
test-example:
55+
needs: [get-build-matrix]
4356
if: ${{ needs.get-build-matrix.outputs.examples_json != '' }}
4457
strategy:
4558
matrix:
4659
example: ${{ fromJSON(needs.get-build-matrix.outputs.examples_json) }}
4760
fail-fast: false
4861
uses: ./.github/workflows/_example-workflow.yml
4962
with:
50-
node: gaudi
63+
node: xeon
64+
build: false
5165
example: ${{ matrix.example }}
5266
test_compose: true
5367
inject_commit: true
5468
secrets: inherit
5569

5670
get-image-list:
57-
needs: get-build-matrix
71+
needs: [get-build-matrix]
5872
uses: ./.github/workflows/_get-image-list.yml
5973
with:
6074
examples: ${{ needs.get-build-matrix.outputs.EXAMPLES }}
6175

6276
publish:
63-
needs: [get-build-matrix, get-image-list, build-and-test]
64-
if: always() && ${{ needs.get-image-list.outputs.matrix != '' }}
77+
needs: [get-build-matrix, get-image-list, build-images]
78+
if: always()
6579
strategy:
6680
matrix:
6781
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Weekly test all examples on multiple HWs
5+
6+
on:
7+
schedule:
8+
- cron: "30 2 * * 6" # UTC time
9+
workflow_dispatch:
10+
11+
env:
12+
EXAMPLES: ${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
13+
NODES: "gaudi,xeon,rocm,arc"
14+
15+
jobs:
16+
get-test-matrix:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
examples: ${{ steps.get-matrix.outputs.examples }}
20+
nodes: ${{ steps.get-matrix.outputs.nodes }}
21+
steps:
22+
- name: Create Matrix
23+
id: get-matrix
24+
run: |
25+
examples=($(echo ${EXAMPLES} | tr ',' ' '))
26+
examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
27+
echo "examples=$examples_json" >> $GITHUB_OUTPUT
28+
nodes=($(echo ${NODES} | tr ',' ' '))
29+
nodes_json=$(printf '%s\n' "${nodes[@]}" | sort -u | jq -R '.' | jq -sc '.')
30+
echo "nodes=$nodes_json" >> $GITHUB_OUTPUT
31+
32+
build-comps-base:
33+
needs: [get-test-matrix]
34+
strategy:
35+
matrix:
36+
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}
37+
uses: ./.github/workflows/_build_comps_base_image.yml
38+
with:
39+
node: ${{ matrix.node }}
40+
41+
run-examples:
42+
needs: [get-test-matrix, build-comps-base]
43+
strategy:
44+
matrix:
45+
example: ${{ fromJson(needs.get-test-matrix.outputs.examples) }}
46+
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}
47+
fail-fast: false
48+
uses: ./.github/workflows/_example-workflow.yml
49+
with:
50+
node: ${{ matrix.node }}
51+
example: ${{ matrix.example }}
52+
build: true
53+
test_compose: true
54+
test_helmchart: true
55+
secrets: inherit

0 commit comments

Comments
 (0)