diff --git a/.github/workflows/dash-bmv2-ci.yml b/.github/workflows/dash-bmv2-ci.yml index f1cb7b2e1..be19deeb1 100644 --- a/.github/workflows/dash-bmv2-ci.yml +++ b/.github/workflows/dash-bmv2-ci.yml @@ -62,6 +62,8 @@ jobs: run: make docker-bmv2-bldr - name: Generate SAI API run: DOCKER_FLAGS=$docker_fg_flags make sai + - name: Check if SAI spec is updated + run: DOCKER_FLAGS=$docker_fg_flags make check-sai-spec - name: Build libsai c++ tests run: DOCKER_FLAGS=$docker_fg_flags make test - name: Prepare network diff --git a/dash-pipeline/Makefile b/dash-pipeline/Makefile index fe7c42680..6b4c8cd40 100644 --- a/dash-pipeline/Makefile +++ b/dash-pipeline/Makefile @@ -237,6 +237,14 @@ sai-clean: SAI/SAI libsai-clean saithrift-server-clean rm -rf SAI/SAI/inc SAI/SAI/experimental SAI/SAI/meta cd SAI/SAI && git checkout -- inc experimental meta +.PHONY:check-sai-spec +check-sai-spec: + if git status | grep -q "SAI/specs"; then \ + echo 'SAI specs have changed, please run "make sai-headers" locally and commit the changes for review.'; \ + echo ""; echo "SAI spec diff found as below:"; \ + git diff SAI/specs; \ + exit 1; \ + fi # Run to recreate same environment as building saithrift client & server run-saithrift-bldr-bash: