setup Machamp ci

This commit is contained in:
zliang 2022-04-22 12:08:39 -06:00
parent 71121dff4e
commit deef34b2f7
3 changed files with 59 additions and 0 deletions

18
build.yaml Normal file
View File

@ -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

21
build_test.sh Normal file
View File

@ -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

20
ci.yaml Normal file
View File

@ -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"]