@@ -13,6 +13,13 @@ REMOTE="https://github.com/${GITHUB_REPOSITORY:-CycloneDX/specification}.git"
13
13
BUF_IMAGE_VERSION=' 1.50.0'
14
14
BUF_IMAGE=" bufbuild/buf:$BUF_IMAGE_VERSION "
15
15
16
+ LOG_FORMAT=' text' # set to 'json' to see details
17
+ if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
18
+ then
19
+ LOG_FORMAT=' github-actions'
20
+ fi
21
+
22
+
16
23
# # ----
17
24
18
25
@@ -24,13 +31,6 @@ function prepare () {
24
31
function schema-lint () {
25
32
echo ' > lint schema files' >&2
26
33
27
- if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
28
- then
29
- LOG_FORMAT=' github-actions'
30
- else
31
- LOG_FORMAT=' text'
32
- fi
33
-
34
34
docker run --rm \
35
35
--volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
36
36
--volume " ${THIS_PATH} /buf_lint.yaml:/workspace/buf.yaml:ro" \
@@ -46,17 +46,11 @@ function schema-lint () {
46
46
function schema-breaking-version () {
47
47
echo ' > test schema for breaking changes against previous version' >&2
48
48
49
- if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
50
- then
51
- LOG_FORMAT=' github-actions'
52
- else
53
- LOG_FORMAT=' text'
54
- fi
55
-
56
49
function compare() {
57
- NEW=" bom-${1} .proto"
58
- OLD=" bom-${2} .proto"
50
+ local NEW=" bom-${1} .proto"
51
+ local OLD=" bom-${2} .proto"
59
52
53
+ local NEW_NP OLD_NP
60
54
NEW_NP=" $( mktemp) "
61
55
OLD_NP=" $( mktemp) "
62
56
@@ -77,8 +71,8 @@ function schema-breaking-version () {
77
71
--error-format " $LOG_FORMAT "
78
72
}
79
73
80
- # compare '1.6' '1.5' # <-- possible breaks are acknowledged
81
- # compare '1.5' '1.4' # <-- possible breaks are acknowledged
74
+ compare ' 1.6' ' 1.5' || echo " possible breaks are acknowledged for this specific version only "
75
+ compare ' 1.5' ' 1.4' || echo " possible breaks are acknowledged for this specific version only "
82
76
compare ' 1.4' ' 1.3'
83
77
84
78
echo ' >> OK.' >&2
@@ -87,13 +81,6 @@ function schema-breaking-version () {
87
81
function schema-breaking-remote () {
88
82
echo ' > test schema for breaking changes against remote' >&2
89
83
90
- if [[ -n " ${GITHUB_WORKFLOW:- } " ]]
91
- then
92
- LOG_FORMAT=' github-actions'
93
- else
94
- LOG_FORMAT=' text'
95
- fi
96
-
97
84
docker run --rm \
98
85
--volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
99
86
--volume " ${THIS_PATH} /buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
@@ -110,10 +97,10 @@ function schema-functional () {
110
97
echo ' > test all examples against the respective schema' >&2
111
98
112
99
function validate() {
113
- FILE=" $1 "
114
- SCHEMA_VERS=" $2 "
115
- SCHEMA_FILE=" bom-${SCHEMA_VERS} .proto"
116
- MESSAGE=" cyclonedx.v${SCHEMA_VERS/ ./ _} .Bom"
100
+ local FILE=" $1 "
101
+ local SCHEMA_VERS=" $2 "
102
+ local SCHEMA_FILE=" bom-${SCHEMA_VERS} .proto"
103
+ local MESSAGE=" cyclonedx.v${SCHEMA_VERS/ ./ _} .Bom"
117
104
118
105
echo " >> validate $( realpath --relative-to=" $PWD " " $FILE " ) as ${MESSAGE} of ${SCHEMA_FILE} " >&2
119
106
@@ -130,6 +117,7 @@ function schema-functional () {
130
117
--to /dev/null
131
118
}
132
119
120
+ local SCHEMA_VERS
133
121
shopt -s globstar
134
122
for test_res in " $ROOT_PATH " /" $TEST_RES_DIR " /* /valid-* .textproto
135
123
do
0 commit comments