-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
48 lines (44 loc) · 1.45 KB
/
bitbucket-pipelines.yml
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
41
42
43
44
45
46
47
48
# Template Go (Golang) build
# This template allows you to validate your Go (Golang) code.
# The workflow allows running tests, build and code linting on the default branch.
image: golang:1.22
definitions:
steps:
- step: &build
name: Build
script:
- go build .
- step: &test
name: Test
script:
- mkdir test-reports
- go install github.com/jstemmer/go-junit-report/v2@latest
- go test -v 2>&1 ./... | go-junit-report -set-exit-code > test-reports/report.xml
artifacts: # defining the artifacts to be passed to each future step.
- test-reports/**
- reports/*.txt
- step: &lint
name: Lint code
image: golangci/golangci-lint:v1.31.0
script:
- golangci-lint run -v
- step: &replicate-to-github
name: Replicate main branch to GitHub
script:
- git fetch --unshallow && git checkout main && git pull
- git remote rename origin bitbucket
- git remote add origin [email protected]:atlassian/terraform-provider-atlassian-operations.git
- git pull --rebase
- git checkout -b release-from-bitbucket
- git push --set-upstream origin release-from-bitbucket --force
pipelines:
default:
- parallel:
- step: *build
custom:
replicate-to-github:
- step: *replicate-to-github
pull-requests:
'**':
- step: *test
# - step: *lint