Skip to content

Commit

Permalink
[ci] Update CI to ensure SAI spec are generated and updated. (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f committed Jun 26, 2024
1 parent 36ead21 commit 9220af1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dash-bmv2-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions dash-pipeline/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9220af1

Please sign in to comment.