good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pggat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gfx
pggat
Commits
1990102f
Commit
1990102f
authored
1 year ago
by
a
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml
parent
4b1bd2cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+48
-15
48 additions, 15 deletions
.gitlab-ci.yml
with
48 additions
and
15 deletions
.gitlab-ci.yml
+
48
−
15
View file @
1990102f
jsonnet
:
stage
:
build
image
:
alpine:latest
.go-cache
:
variables
:
GOPATH
:
$CI_PROJECT_DIR/.go
before_script
:
-
mkdir -p .go
cache
:
paths
:
-
.go/pkg/mod/
stages
:
-
test
test
:
image
:
golang:1.21-alpine
stage
:
test
extends
:
.go-cache
script
:
-
apk add -U jsonnet
-
jsonnet .gitlab-ci.jsonnet > generated-config.yml
-
CGO_ENABLED=1 go test -race ./...
lint
:
image
:
registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
stage
:
test
extends
:
.go-cache
script
:
# Use default .golangci.yml file from the image if one is not present in the project root.
-
"
[
-e
.golangci.yml
]
||
cp
/golangci/.golangci.yml
."
# Write the code coverage report to gl-code-quality-report.json
# and print linting issues to stdout in the format: path/to/file:line description
# remove `--issues-exit-code 0` or set to non-zero to fail the job if linting issues are detected
-
golangci-lint run --issues-exit-code 0 --print-issued-lines=false --out-format code-climate:gl-code-quality-report.json,line-number
artifacts
:
when
:
always
reports
:
codequality
:
gl-code-quality-report.json
paths
:
-
g
enerated-config.yml
-
g
l-code-quality-report.json
trigger-builds
:
stage
:
build
needs
:
-
jsonnet
trigger
:
include
:
-
artifact
:
generated-config.yml
job
:
jsonnet
strategy
:
depend
coverage
:
stage
:
test
image
:
golang:1.21-alpine
coverage
:
'
/\(statements\)(?:\s+)?(\d+(?:\.\d+)?%)/'
extends
:
.go-cache
script
:
-
go run gotest.tools/gotestsum@latest --junitfile report.xml --format testname -- -coverprofile=coverage.txt -covermode count ./...
-
go tool cover -func=coverage.txt
-
go run github.com/boumenot/gocover-cobertura@master < coverage.txt > coverage.xml
artifacts
:
reports
:
junit
:
report.xml
coverage_report
:
coverage_format
:
cobertura
path
:
coverage.xml
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment