11
11
branches : [ main ]
12
12
pull_request :
13
13
branches : [ main ]
14
- types : [opened, synchronize, reopened]
14
+ types : [opened, synchronize, reopened, edited ]
15
15
paths :
16
16
- ' docs/static/llama-stack-spec.yaml'
17
17
- ' docs/static/llama-stack-spec.html'
@@ -27,21 +27,39 @@ jobs:
27
27
check-schema-compatibility :
28
28
runs-on : ubuntu-latest
29
29
steps :
30
- # Using specific version 4.1.7 because 5.0.0 fails when trying to run this locally using `act`
31
- # This ensures consistent behavior between local testing and CI
32
30
- name : Checkout PR Code
33
31
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32
+ with :
33
+ fetch-depth : 0
34
+
35
+ # Check if we should skip conformance testing due to breaking changes
36
+ - name : Check if conformance test should be skipped
37
+ id : skip-check
38
+ run : |
39
+ PR_TITLE="${{ github.event.pull_request.title }}"
34
40
41
+ # Skip if title contains "!:" indicating breaking change (like "feat!:")
42
+ if [[ "$PR_TITLE" == *"!:"* ]]; then
43
+ echo "skip=true" >> $GITHUB_OUTPUT
44
+ exit 0
45
+ fi
46
+
47
+ # Get all commits in this PR and check for BREAKING CHANGE footer
48
+ git log --format="%B" ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | \
49
+ grep -q "BREAKING CHANGE:" && echo "skip=true" >> $GITHUB_OUTPUT || echo "skip=false" >> $GITHUB_OUTPUT
50
+ shell : bash
35
51
# Checkout the base branch to compare against (usually main)
36
52
# This allows us to diff the current changes against the previous state
37
53
- name : Checkout Base Branch
54
+ if : steps.skip-check.outputs.skip != 'true'
38
55
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
39
56
with :
40
57
ref : ${{ github.event.pull_request.base.ref }}
41
58
path : ' base'
42
59
43
60
# Cache oasdiff to avoid checksum failures and speed up builds
44
61
- name : Cache oasdiff
62
+ if : steps.skip-check.outputs.skip != 'true'
45
63
id : cache-oasdiff
46
64
uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
47
65
with :
@@ -50,20 +68,27 @@ jobs:
50
68
51
69
# Install oasdiff: https://github.com/oasdiff/oasdiff, a tool for detecting breaking changes in OpenAPI specs.
52
70
- name : Install oasdiff
53
- if : steps.cache-oasdiff.outputs.cache-hit != 'true'
71
+ if : steps.skip-check.outputs.skip != 'true' && steps. cache-oasdiff.outputs.cache-hit != 'true'
54
72
run : |
55
73
curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | sh
56
74
cp /usr/local/bin/oasdiff ~/oasdiff
57
75
58
76
# Setup cached oasdiff
59
77
- name : Setup cached oasdiff
60
- if : steps.cache-oasdiff.outputs.cache-hit == 'true'
78
+ if : steps.skip-check.outputs.skip != 'true' && steps. cache-oasdiff.outputs.cache-hit == 'true'
61
79
run : |
62
80
sudo cp ~/oasdiff /usr/local/bin/oasdiff
63
81
sudo chmod +x /usr/local/bin/oasdiff
64
82
65
83
# Run oasdiff to detect breaking changes in the API specification
66
84
# This step will fail if incompatible changes are detected, preventing breaking changes from being merged
67
85
- name : Run OpenAPI Breaking Change Diff
86
+ if : steps.skip-check.outputs.skip != 'true'
68
87
run : |
69
88
oasdiff breaking --fail-on ERR base/docs/static/llama-stack-spec.yaml docs/static/llama-stack-spec.yaml --match-path '^/v1/'
89
+
90
+ # Report when test is skipped
91
+ - name : Report skip reason
92
+ if : steps.skip-check.outputs.skip == 'true'
93
+ run : |
94
+ echo "Conformance test skipped due to breaking change indicator"
0 commit comments