Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boilr
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ifs
boilr
Commits
ae8f89f3
Commit
ae8f89f3
authored
1 year ago
by
Nicola Jordan
Browse files
Options
Downloads
Patches
Plain Diff
added gitlab-ci
parent
975c8aa5
No related branches found
No related tags found
No related merge requests found
Pipeline
#257644
failed with stage
in 1 minute and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+78
-0
78 additions, 0 deletions
.gitlab-ci.yml
with
78 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
78
−
0
View file @
ae8f89f3
image
:
golang:latest
stages
:
-
build
format
:
stage
:
build
script
:
-
test -z "$(gofmt -l ./)"
vet
:
stage
:
build
script
:
-
go vet -json ./... | tee vet-report.json
artifacts
:
when
:
always
paths
:
-
vet-report.json
expire_in
:
1 hour
test
:
stage
:
build
script
:
-
go test -coverprofile=coverage.out -json ./... | tee test-report.json
artifacts
:
when
:
always
paths
:
-
test-report.json
-
coverage.out
expire_in
:
1 hour
staticcheck
:
stage
:
build
script
:
-
go install honnef.co/go/tools/cmd/staticcheck@latest
# ideally we should version pin
-
staticcheck ./...
golint
:
stage
:
build
script
:
-
go install golang.org/x/lint/golint@latest
# ideally we should version pin
-
golint -set_exit_status ./...
build
:
stage
:
build
script
:
-
go build ./...
artifacts
:
# instead of manually adding i.e. the built binaries, we can instead just
# grab anything not tracked in Git
untracked
:
true
expire_in
:
1 hour
# sonar instance needs to be running on localhost:9000 for this to work!
sonarcloud-check
:
stage
:
build
needs
:
-
job
:
test
artifacts
:
true
-
job
:
vet
artifacts
:
true
image
:
name
:
sonarsource/sonar-scanner-cli:latest
entrypoint
:
[
"
"
]
variables
:
SONAR_USER_HOME
:
"
${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH
:
"
0"
cache
:
key
:
"
${CI_JOB_NAME}"
paths
:
-
.sonar/cache
script
:
-
sonar-scanner
# deploy:
# stage: deploy
# script: echo "Define your deployment script!"
# environment: production
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