21
21
- ' .dockerignore'
22
22
- ' sai.env'
23
23
24
+ env :
25
+ DOCKER_BASE : ' dockerfiles/bullseye/Dockerfile'
26
+ DOCKER_REDIS : ' npu/broadcom/BCM56850/saivs/Dockerfile'
27
+ DOCKER_THRIFT : ' npu/broadcom/BCM56850/saivs/Dockerfile.saithrift'
28
+ REDIS_RPC : 0
29
+ THRIFT_RPC : 0
30
+
24
31
jobs :
25
- build-sc-stadalone-thrift :
32
+ build-sc-stadalone :
26
33
name : Build SAI Challenger standalone image
27
34
runs-on : ubuntu-20.04
28
35
steps :
29
36
- uses : actions/checkout@v3
37
+ with :
38
+ fetch-depth : 2
30
39
- name : Update submodules
31
40
run : git submodule update --init
41
+
42
+ - name : Check what files were updated
43
+ id : check_changes
44
+ run : |
45
+ echo 'changed_files<<EOF' >> $GITHUB_OUTPUT
46
+ echo "$(git diff --name-only HEAD~1)" >> $GITHUB_OUTPUT
47
+ echo 'EOF' >> $GITHUB_OUTPUT
48
+
49
+ - name : Check what Docker images have to be rebuild
50
+ run : |
51
+ for file in "$DOCKER_BASE" "$DOCKER_REDIS"; do
52
+ if [[ "${{ steps.check_changes.outputs.changed_files }}" == *"$file"* ]]; then
53
+ echo "REDIS_RPC=1" >> $GITHUB_ENV
54
+ fi
55
+ done
56
+ for file in "$DOCKER_BASE" "$DOCKER_THRIFT"; do
57
+ if [[ "${{ steps.check_changes.outputs.changed_files }}" == *"$file"* ]]; then
58
+ echo "THRIFT_RPC=1" >> $GITHUB_ENV
59
+ fi
60
+ done
61
+
32
62
- name : Build standalone Docker image
33
63
run : ./build.sh -i standalone -o deb11
64
+ if : ${{ env.REDIS_RPC == '1' }}
65
+
34
66
- name : Start SAI-C in standalone mode
35
67
run : ./run.sh -i standalone -o deb11
68
+ - name : Update SAI-C package
69
+ run : ./exec.sh --no-tty pip3 install /sai-challenger/common /sai-challenger
70
+ if : ${{ env.REDIS_RPC == '0' }}
71
+
36
72
- name : Run tests
37
73
run : ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic.py -v test_vrf.py -v test_dc_t1.py
38
74
- name : Run sairedis tests
@@ -42,10 +78,17 @@ jobs:
42
78
" test_acl_ut or test_bridge_ut or (test_switch_ut and not sai_map_list_t) or test_vrf_ut or test_port_ut.py"
43
79
- name : Run data-driven tests
44
80
run : ./exec.sh --no-tty pytest --testbed=saivs_standalone -v test_l2_basic_dd.py
81
+
45
82
- name : Build standalone docker image with SAI thrift
46
83
run : ./build.sh -i standalone -s thrift -o deb11
84
+ if : ${{ env.THRIFT_RPC == '1' }}
85
+
47
86
- name : Start SAI-C in standalone mode with SAI thrift
48
87
run : ./run.sh -i standalone -s thrift -o deb11
88
+ - name : Update SAI-C package
89
+ run : ./exec.sh --no-tty -s thrift pip3 install /sai-challenger/common /sai-challenger
90
+ if : ${{ env.THRIFT_RPC == '0' }}
91
+
49
92
- name : Run thrift tests
50
93
run : ./exec.sh --no-tty -s thrift pytest --testbed=saivs_thrift_standalone -v test_l2_basic.py -v test_vrf.py -v test_dc_t1.py
51
94
- name : Run thift data-driven tests
0 commit comments