-
Notifications
You must be signed in to change notification settings - Fork 11
/
screwdriver.yaml
35 lines (33 loc) · 1.51 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
32
33
34
35
shared:
image: golang:1.19
environment:
GOPATH: /sd/workspace
jobs:
test:
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: [~pr, ~commit]
steps:
- gover: go version
- tidy: |
go mod tidy
echo 'This step failed because there is an unused module in the go.mod file.'
echo 'Retry again after using the "go mod tidy" command.'
git diff --exit-code --quiet HEAD ./go.mod ./go.sum
- install: go mod download
- gofmt: (! gofmt -d -s . | grep '^')
- test: make test JSONFILE=${SD_ARTIFACTS_DIR}/report.json COVERPROFILE=${SD_ARTIFACTS_DIR}/coverage.out
- build: go build -a -o /dev/null
- test-release: "curl -sL https://git.io/goreleaser | bash -s -- --snapshot"
publish:
requires: [test]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- get: go mod download
- 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