Add breaking change check #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OpenConfig YANG Diff | |
on: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Backward Incompatibility Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Make sure all backward-incompatible changes are covered by version changes. | |
run: | | |
readonly HEAD=${{ github.event.pull_request.head.sha }} | |
readonly BASE="$(git merge-base origin/master "${HEAD}")" | |
BASEREPODIR=public_base | |
git clone "https://github.com/openconfig/public.git" "${BASEREPODIR}" | |
cd "${BASEREPODIR}" | |
git checkout "${BASE}" | |
cd .. | |
oldroot="${BASEREPODIR}" | |
newroot=. | |
oldfiles=$(find "${oldroot}"/release/models -name '*.yang' | tr '\n' ',') | |
newfiles=$(find "${newroot}"/release/models -name '*.yang' | tr '\n' ',') | |
go install github.com/openconfig/models-ci@fca2350 | |
models-ci diff --disallowed-incompats --oldp "${oldroot}/third_party" --oldfiles "${oldfiles}" --newp "${newroot}/third_party" --newfiles "${newfiles}" |