-
Notifications
You must be signed in to change notification settings - Fork 24
/
screwdriver.yaml
40 lines (40 loc) · 1.68 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
36
37
38
39
40
shared:
environment:
DOCKER_REPO: screwdrivercd/launcher
GO111MODULE: on
jobs:
main:
image: golang:1.19
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:
- gover: go version
- install: go mod download
- vet: go vet ./...
- gofmt: (! gofmt -d . | grep '^')
- test-setup: go install gotest.tools/gotestsum@latest
- test: gotestsum --format testname --jsonfile ${SD_ARTIFACTS_DIR}/report.json -- -coverprofile=${SD_ARTIFACTS_DIR}/coverage.out ./...
# Ensure we can compile
- build: go build -a -o /dev/null
# Test cross-compiling as well
- test-release: "curl -sL https://git.io/goreleaser | bash -s -- --snapshot"
publish:
image: golang:1.19
requires: main
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
docker-publish:
environment:
DOCKER_MULTI_PLATFORM_BUILDS_ENABLED: 1
DOCKER_BUILDKIT: 1
requires: [~pr, publish]
template: sd/dind@latest