diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ace7779 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +include: + - template: Security/SAST.gitlab-ci.yml + +image: golang:latest + +variables: + REPO_NAME: git.flifloo.fr/flifloo/crowdsec-notification-telegram + +before_script: + - mkdir -p $GOPATH/src/$(dirname $REPO_NAME) + - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME + - cd $GOPATH/src/$REPO_NAME + +stages: + - test + - build + +format: + stage: test + script: + - go fmt $(go list ./... | grep -v /vendor/) + - go vet $(go list ./... | grep -v /vendor/) + - go test -race $(go list ./... | grep -v /vendor/) + +sast: + stage: test + artifacts: + name: sast + paths: + - gl-sast-report.json + reports: + sast: gl-sast-report.json + when: always + +compile: + stage: build + script: + - make build + artifacts: + paths: + - notification-telegram