Skip to content

Commit

Permalink
Merge pull request openconfig#936 from openconfig/test-ci
Browse files Browse the repository at this point in the history
Add breaking change check
  • Loading branch information
wenovus authored Aug 8, 2023
2 parents dcefed0 + 098e81c commit 0701ffe
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Breaking Changes

on:
pull_request:
branches: [ master ]

jobs:
build:
name: major version update check
runs-on: ubuntu-latest

steps:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: '1.x'

- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install openconfig-ci CLI
run: |
go install github.com/openconfig/models-ci/openconfig-ci@c880ed2
- name: Make sure all backward-incompatible changes are covered by version changes.
id: check
run: |
readonly HEAD=${{ github.event.pull_request.head.sha }}
readonly BASE="$(git merge-base origin/master "${HEAD}")"
BASEREPODIR=public_base
mkdir -p "${BASEREPODIR}/release"
git checkout "${BASE}"
cp -r release/models "${BASEREPODIR}/release"
cp -r third_party "${BASEREPODIR}"
git checkout "${HEAD}"
oldroot="${BASEREPODIR}"
newroot=.
openconfig-ci diff --disallowed-incompats --oldp "${oldroot}/third_party" --oldroot "${oldroot}/release/models" --newp "${newroot}/third_party" --newroot "${newroot}/release/models"
14 changes: 2 additions & 12 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ steps:
git clone [email protected]:openconfig/models-ci.git /go/src/github.com/openconfig/models-ci
cd /go/src/github.com/openconfig/models-ci
# Modify the major version to update models-ci version.
branch=$(git tag -l 'v10.*' | sort -V | tail -1)
branch=$(git tag -l 'v11.*' | sort -V | tail -1)
git checkout $branch
volumes:
- name: 'ssh'
Expand Down Expand Up @@ -213,16 +213,6 @@ steps:
id: 'oc-pyang'

############### GOYANG/YGOT ###############
- name: 'golang'
entrypoint: 'go'
args: ['install', 'github.com/openconfig/ygot/generator@latest']
volumes:
- name: 'gopath'
path: /go
env:
- 'GOPATH=/go'
waitFor: ['go path creation']
id: 'goyang-ygot prep'
- name: 'us-west1-docker.pkg.dev/$PROJECT_ID/models-ci/models-ci-image'
entrypoint: 'bash'
args: ['-c', "/go/src/github.com/openconfig/models-ci/validators/goyang-ygot/test.sh"]
Expand All @@ -237,7 +227,7 @@ steps:
- 'COMMIT_SHA=$COMMIT_SHA'
- '_REPO_SLUG=$_REPO_SLUG'
- 'BRANCH_NAME=$BRANCH_NAME'
waitFor: ['validator prep', 'goyang-ygot prep', 'oc-pyang']
waitFor: ['validator prep', 'go path creation', 'oc-pyang']
id: 'goyang-ygot'

############### PYANG ###############
Expand Down

0 comments on commit 0701ffe

Please sign in to comment.