diff --git a/files/default.yml b/files/default.yml new file mode 100644 index 0000000000000000000000000000000000000000..33ac4cc62cf3f5a7bb8b6fc3e24f09c4a7bc61f7 --- /dev/null +++ b/files/default.yml @@ -0,0 +1,7 @@ +include: + - remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/image.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/variables.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/cache.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/stages.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/before-script.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/templates/matrix.yml diff --git a/files/templates/before-script.yml b/files/templates/before-script.yml new file mode 100644 index 0000000000000000000000000000000000000000..d58cff397b0a40caa29d38fcc7c19410cc1c48de --- /dev/null +++ b/files/templates/before-script.yml @@ -0,0 +1,10 @@ +before_script: + - curl -o "${CI_PROJECT_DIR}/Makefile" https://git-cdn.e15r.co/gitlab/ci/golang/-/raw/main/files/Makefile + - mkdir -p $GOPATH/src/$(dirname $REPO_NAME) + - cp -R $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME + - cd $GOPATH/src/$REPO_NAME + - cp config-sample.json config.json + + - export CC=clang + + - make dep diff --git a/files/templates/cache.yml b/files/templates/cache.yml new file mode 100644 index 0000000000000000000000000000000000000000..bf6e933c5972b5e09f95b7855260f29f1b26e04b --- /dev/null +++ b/files/templates/cache.yml @@ -0,0 +1,7 @@ +cache: + paths: + - /apt-cache + - $GOPATH/src/github.com + - $GOPATH/src/golang.org + - $GOPATH/src/google.golang.org + - $GOPATH/src/gopkg.in diff --git a/files/templates/image.yml b/files/templates/image.yml new file mode 100644 index 0000000000000000000000000000000000000000..d07b5f54f562d229b4dd03a81b1a9ea064a75ba0 --- /dev/null +++ b/files/templates/image.yml @@ -0,0 +1 @@ +image: containers.ethitter.com:443/docker/images/golang:latest diff --git a/files/templates/matrix.yml b/files/templates/matrix.yml new file mode 100644 index 0000000000000000000000000000000000000000..b6577e3d66d9643459b4bb54daf386b2b85424fa --- /dev/null +++ b/files/templates/matrix.yml @@ -0,0 +1,39 @@ +unit_tests: + stage: test + script: + - make test + +race_detector: + stage: test + script: + - make race + +memory_sanitizer: + stage: test + script: + - make msan + +code_coverage: + stage: test + script: + - make coverage + +code_coverage_report: + stage: test + script: + - make coverhtml + only: + - master + +lint_code: + stage: test + script: + - make lint + +build: + stage: build + script: + - make + artifacts: + paths: + - dyndnsd-client/ diff --git a/files/templates/stages.yml b/files/templates/stages.yml new file mode 100644 index 0000000000000000000000000000000000000000..df24ad8a016d592717f3db40f45466ad650ca623 --- /dev/null +++ b/files/templates/stages.yml @@ -0,0 +1,3 @@ +stages: + - test + - build diff --git a/files/templates/variables.yml b/files/templates/variables.yml new file mode 100644 index 0000000000000000000000000000000000000000..96cb89c9102cc6cf333444f77062dc512725ea2d --- /dev/null +++ b/files/templates/variables.yml @@ -0,0 +1,2 @@ +variables: + REPO_NAME: "${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/$(CI_PROJECT_NAME)"