-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jan Kowalleck <[email protected]>
- Loading branch information
1 parent
8503f10
commit 96a4a63
Showing
3 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
|
||
name: CT ProtoBuf | ||
|
||
on: | ||
push: | ||
branches: ['master', 'main'] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
# see https://github.com/actions/checkout | ||
uses: actions/checkout@v4 | ||
- name: run tests | ||
run: tools/src/test/proto-test.sh |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
#!/usr/bin/env bash | ||
mkdir -p proto-test | ||
for filename in resources/1.3/*.textproto; | ||
do | ||
protoc --proto_path=../../../schema/ --encode=cyclonedx.v1_3.Bom bom-1.3-SNAPSHOT.proto < $filename | protoc --proto_path=../../../schema/ --decode=cyclonedx.v1_3.Bom bom-1.3-SNAPSHOT.proto > proto-test/${filename##*/} | ||
done; | ||
set -ex | ||
|
||
if [[ -n "$CI" ]] | ||
then | ||
LOG_FORMAT="github-actions" | ||
else | ||
LOG_FORMAT="json" | ||
fi | ||
|
||
# lint protobuf schema files | ||
docker run \ | ||
--volume "$(pwd):/workspace" \ | ||
--workdir /workspace \ | ||
bufbuild/buf:1.29.0 \ | ||
lint --error-format "$LOG_FORMAT" | ||
|
||
# check protobuf schema files for breaking changes | ||
# docker run \ | ||
# --volume "$(pwd):/workspace" \ | ||
# --workdir /workspace \ | ||
# bufbuild/buf:1.29.0 \ | ||
# breaking | ||
|
||
# test all examples against the schema files | ||
# mkdir -p proto-test | ||
# for filename in resources/1.3/*.textproto; | ||
# do | ||
# protoc --proto_path=../../../schema/ --encode=cyclonedx.v1_3.Bom bom-1.3-SNAPSHOT.proto < $filename | protoc --proto_path=../../../schema/ --decode=cyclonedx.v1_3.Bom bom-1.3-SNAPSHOT.proto > proto-test/${filename##*/} | ||
# done |