Add breaking change in common.yaml #171
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Check API Contracts | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Get changed yaml files | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v34 | |
with: | |
files: | | |
in/**/*.yaml | |
in/**/*.yml | |
in/**/*.json | |
files_ignore: kafka.yaml #skipping it as async is under private-beta | |
- name: Install Spectral Linter | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: npm install -g @stoplight/spectral-cli | |
- name: Run Spectral linter on changed files | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: | | |
echo "Running Spectral linter on: ${{ steps.changed-files-specific.outputs.all_changed_files }}" | |
spectral lint in/**/*.yaml | |
- name: Create environment file | |
run: | | |
echo "GITHUB_REF=${{ github.ref }}" >> env.list | |
echo "GITHUB_SHA=${{ github.sha }}" >> env.list | |
echo "GITHUB_REPOSITORY=${{ github.repository }}" >> env.list | |
echo "GITHUB_ACTOR=${{ github.actor }}" >> env.list | |
echo "GITHUB_WORKFLOW=${{ github.workflow }}" >> env.list | |
echo "GITHUB_HEAD_REF=${{ github.head_ref }}" >> env.list | |
echo "GITHUB_BASE_REF=${{ github.base_ref }}" >> env.list | |
- name: Run backward compatibility check on changed files | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: | | |
docker run -v "$(pwd):/central-contract-repo:rw" \ | |
--env-file env.list \ | |
--entrypoint /bin/sh znsio/specmatic \ | |
-c "git config --global --add safe.directory /central-contract-repo && cd /central-contract-repo && java -jar /usr/src/app/specmatic.jar backwardCompatibilityCheck" | |