mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
67f939fc66
* manager, cli and agent vtpm support * rebase and changed atls for vtpm * deleted unused code * changed chekproto.yaml script so it find the manager proto file correctly * fixe manager proto version * fix agent tests * fix server agent test * fix attestation test * fix attestation test gofumpt * created dummy RWC for TPM * fix comment * add default PCR values * rebase main * fix rust ci and missing header * changed embedded attestation to VMPL 2 * fix unused impot * fix pkg test * address attestation type * fix agent attestation test * add prc15 check * fix comments * fix cli tests * add doc * add mock for LeveledQuoteProvider when SEV-SNP device is not found Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix manager reading attestation policy * refactor PCR value checks and update attestation policy values Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix tests for sev and grpc --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com> Co-authored-by: Sammy Oina <sammyoina@gmail.com>
83 lines
2.2 KiB
YAML
83 lines
2.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "manager/manager.proto"
|
|
- "pkg/manager/*.pb.go"
|
|
- "agent/agent.proto"
|
|
- "agent/*.pb.go"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "manager/manager.proto"
|
|
- "pkg/manager/*.pb.go"
|
|
- "agent/agent.proto"
|
|
- "agent/*.pb.go"
|
|
|
|
jobs:
|
|
checkproto:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.23.x
|
|
|
|
- name: Set up protoc
|
|
run: |
|
|
PROTOC_VERSION=29.3
|
|
PROTOC_GEN_VERSION=v1.36.4
|
|
PROTOC_GRPC_VERSION=v1.5.1
|
|
|
|
# Download and install protoc
|
|
PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip
|
|
curl -0L -o $PROTOC_ZIP https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP
|
|
unzip -o $PROTOC_ZIP -d protoc3
|
|
sudo mv protoc3/bin/* /usr/local/bin/
|
|
sudo mv protoc3/include/* /usr/local/include/
|
|
rm -rf $PROTOC_ZIP protoc3
|
|
|
|
# Install protoc-gen-go and protoc-gen-go-grpc
|
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@$PROTOC_GEN_VERSION
|
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$PROTOC_GRPC_VERSION
|
|
|
|
# Add protoc to the PATH
|
|
export PATH=$PATH:/usr/local/bin/protoc
|
|
|
|
- name: Set up Cocos-AI
|
|
run: |
|
|
# Rename .pb.go files to .pb.go.tmp to prevent conflicts
|
|
for p in $(ls manager/*.pb.go); do
|
|
mv $p $p.tmp
|
|
done
|
|
|
|
for p in $(ls agent/*.pb.go); do
|
|
mv $p $p.tmp
|
|
done
|
|
|
|
# Generate Go files from protobuf definitions
|
|
make protoc
|
|
|
|
# Compare generated Go files with the original ones
|
|
for p in $(ls manager/*.pb.go); do
|
|
if ! cmp -s $p $p.tmp; then
|
|
echo "Proto file and generated Go file $p are out of sync!"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
for p in $(ls agent/*.pb.go); do
|
|
if ! cmp -s $p $p.tmp; then
|
|
echo "Proto file and generated Go file $p are out of sync!"
|
|
exit 1
|
|
fi
|
|
done
|