Skip to content
Open

test #56

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
inputSet:
name: Build_goHelloWorldServer_1700069474341-pr-trigger-input-set
identifier: Build_goHelloWorldServer_1700069474341prtriggerinputset
orgIdentifier: default
projectIdentifier: default_project
pipeline:
identifier: Build_goHelloWorldServer_1700069474341
properties:
ci:
codebase:
build:
type: PR
spec:
number: <+trigger.prNumber>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
inputSet:
name: Build_goHelloWorldServer_1700069474341-push-trigger-input-set
identifier: Build_goHelloWorldServer_1700069474341pushtriggerinputset
orgIdentifier: default
projectIdentifier: default_project
pipeline:
identifier: Build_goHelloWorldServer_1700069474341
properties:
ci:
codebase:
build:
type: branch
spec:
branch: <+trigger.branch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pipeline:
id: pipeline_asv108_goHelloWorldServer_build_d8f4
name: pipeline_asv108_goHelloWorldServer_build_d8f4
stages:
- id: build
name: Build
runtime: cloud
clone:
enabled: true
cache:
enabled: true
platform:
os: linux
arch: amd64
steps:
- name: Build
id: build_step
run:
shell: bash
script: go build -v ./...
- name: Test
id: test
run:
shell: bash
script: |-
mkdir -p .harness/reports .harness/coverage
export GOPATH=/harness/.cache/go
export GOMODCACHE=/harness/.cache/go/pkg/mod
export GOCACHE=/harness/.cache/go-build
go install github.com/jstemmer/go-junit-report/v2@v2.1.0
set +e
go test -v -coverprofile=.harness/coverage/coverage.out ./... 2>&1 | tee .harness/reports/go-test.log
test_status=${PIPESTATUS[0]}
"$(go env GOPATH)/bin/go-junit-report" -set-exit-code < .harness/reports/go-test.log > .harness/reports/junit.xml
report_status=$?
set -e
if [ "$test_status" -ne 0 ]; then exit "$test_status"; fi
exit "$report_status"
report:
type: junit
paths:
- .harness/reports/junit.xml
- name: Upload Coverage
id: upload_coverage
run:
shell: bash
script: |-
test -s ".harness/coverage/coverage.out"
hcli cov upload --file=".harness/coverage/coverage.out"
tags:
onboarding: "true"
51 changes: 51 additions & 0 deletions .harness/pipelines/goHelloWorldServer-1700069460894.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pipeline:
identifier: Build_goHelloWorldServer_1700069474341
name: Build goHelloWorldServer
orgIdentifier: default
projectIdentifier: default_project
properties:
ci:
codebase:
build: <+input>
connectorRef: account.Github_OAuth_1700069446649
repoName: goHelloWorldServer
stages:
- stage:
identifier: build
name: build
spec:
cloneCodebase: true
execution:
steps:
- step:
identifier: gobuild
name: go_build
spec:
command: go build
timeout: ""
type: Run
- step:
identifier: gotest
name: go_test
spec:
command: go test -v ./...
timeout: ""
type: Run
- step:
identifier: dockerbuild
name: docker_build
spec:
image: plugins/docker
settings:
dry_run: "true"
repo: hello/world
tags: latest
timeout: ""
type: Plugin
platform:
arch: Amd64
os: Linux
runtime:
spec: {}
type: Cloud
type: CI