-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathscrewdriver.yaml
30 lines (27 loc) · 1.29 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
shared:
image: golang:1.19
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:
- modverify: go mod verify
- gofmt: /bin/bash -c 'if [[ -n "$(gofmt -l .)" ]]; then echo "gofmt check fails"; gofmt -d .; exit -1; fi'
- build: GOBIN="$SD_ARTIFACTS_DIR" go install -v ./...
- test-setup: go install gotest.tools/gotestsum@latest
- test: gotestsum --format testname --jsonfile ${SD_ARTIFACTS_DIR}/report.json -- -coverprofile=${SD_ARTIFACTS_DIR}/coverage.out ./...
publish:
requires: [main]
steps:
- setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci
- get: go get -t ./...
- 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