From deef34b2f76a380e5687116acd09ae8d0caf9893 Mon Sep 17 00:00:00 2001 From: zliang Date: Fri, 22 Apr 2022 12:08:39 -0600 Subject: [PATCH] setup Machamp ci --- build.yaml | 18 ++++++++++++++++++ build_test.sh | 21 +++++++++++++++++++++ ci.yaml | 20 ++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 build.yaml create mode 100644 build_test.sh create mode 100644 ci.yaml diff --git a/build.yaml b/build.yaml new file mode 100644 index 000000000..868a60c6e --- /dev/null +++ b/build.yaml @@ -0,0 +1,18 @@ +# Doc: https://wiki.sc-corp.net/pages/viewpage.action?pageId=121500284 +version: 1 +machamp: + keydb-build: + # Optional - build counter is linked to the build def + tag_template: 0.0.%build.counter% + # Optional - value in seconds before a build is terminated, default is 3600 seconds + timeout: 3600 + # Optional - update ghe or not, default to true + update_ghe: true + code_coverage: false + # Required + steps: + make-build: + type: cmd + # Dockerfile for the builder img is in https://github.sc-corp.net/Snapchat/img/tree/master/build/ubuntu/ubuntu-20-04/keydb + builder_image: us.gcr.io/snapchat-build-artifacts/prod/snapchat/img/build/keydb-ubuntu-20-04@sha256:6e3e3b99d89522bf25066d6caeb700207429be99fff8c25866c83896bb1fa811 + command: ./build_test.sh diff --git a/build_test.sh b/build_test.sh new file mode 100644 index 000000000..175b5edd9 --- /dev/null +++ b/build_test.sh @@ -0,0 +1,21 @@ +# make the build +make BUILD_TLS=yes -j2 KEYDB_CFLAGS='-Werror' KEYDB_CXXFLAGS='-Werror' + +# gen-cert +./utils/gen-test-certs.sh + +# test-tls +apt-get -y install tcl tcl-tls +./runtest --clients 2 --verbose --tls + +# cluster-test +./runtest-cluster --tls + +# sentinel test +./runtest-sentinel + +# module tests +./runtest-moduleapi + +# rotation test +./runtest-rotation diff --git a/ci.yaml b/ci.yaml new file mode 100644 index 000000000..6c49d6094 --- /dev/null +++ b/ci.yaml @@ -0,0 +1,20 @@ +# Doc: https://wiki.sc-corp.net/display/TOOL/ci.yaml+User+Guide +version: 1 +on: + pull_request: + - workflows: + # All builds that use machamp should use the defined `backend_workflow` + - workflow_type: backend_workflow + # references a build defined in build.yaml + build_name: keydb-build + push: + - branches: [master] + workflows: + - workflow_type: backend_workflow + build_name: keydb-build + arch_types: ["amd64", "arm64"] + cool: + workflow: + - workflow_type: backend_workflow + build_name: keydb-build + arch_types: ["amd64", "arm64"]