forked from screwdriver-cd/store-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
screwdriver.yaml
31 lines (29 loc) · 1.4 KB
/
screwdriver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
shared:
image: golang
environment:
GO111MODULE: on
jobs:
main:
environment:
SD_SONAR_OPTS: "-Dsonar.sources=./ -Dsonar.exclusions=**/*_test.go,**/vendor/** -Dsonar.tests=./ -Dsonar.test.inclusions=**/*_test.go -Dsonar.test.exclusions=**/vendor/** -Dsonar.go.coverage.reportPaths=${SD_ARTIFACTS_DIR}/coverage.out -Dsonar.go.tests.reportPaths=${SD_ARTIFACTS_DIR}/report.json"
requires: [~commit, ~pr]
steps:
- vet: go vet ./...
- gofmt: ret=$(find . -name '*.go' | xargs gofmt -d) && echo "$ret" && test -z "$ret"
- test-setup: go get gotest.tools/[email protected]
- test: gotestsum --format testname --jsonfile ${SD_ARTIFACTS_DIR}/report.json -- -coverprofile=${SD_ARTIFACTS_DIR}/coverage.out ./...
- build: go build -a -o store-cli
- test-release: "curl -sL https://git.io/goreleaser | bash -s -- --snapshot"
deploy:
requires: main
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- gofmt: ret=$(find . -name '*.go' | xargs gofmt -d) && echo "$ret" && test -z "$ret"
- tag: ./ci/git-tag.sh
- release: |
curl -sL https://git.io/goreleaser | bash
secrets:
# Pushing tags to Git
- GIT_KEY
# Pushing releases to GitHub
- GITHUB_TOKEN