Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bob
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Bob
Commits
23dedcf0
Verified
Commit
23dedcf0
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: ci pipeline
parent
d3e7b5c7
No related branches found
No related tags found
No related merge requests found
Pipeline
#23616
canceled
1 year ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/go-coverage.sh
+0
-35
0 additions, 35 deletions
bin/go-coverage.sh
devenv.nix
+4
-2
4 additions, 2 deletions
devenv.nix
flake.nix
+1
-1
1 addition, 1 deletion
flake.nix
with
5 additions
and
38 deletions
bin/go-coverage.sh
deleted
100755 → 0
+
0
−
35
View file @
d3e7b5c7
#!/bin/bash
#
# Code coverage generation
COVERAGE_DIR
=
"
${
1
}
"
REPORT_DIR
=
"
${
2
}
"
TYPE
=
"
${
3
}
"
cd
"
$COVERAGE_DIR
"
||
exit
1
PKG_LIST
=
$(
go list ./... |
grep
-v
/vendor/
)
# Create the coverage files directory
mkdir
-p
"
$REPORT_DIR
"
;
# Create a coverage file for each package
for
package
in
${
PKG_LIST
}
;
do
go
test
-covermode
=
count
-coverprofile
"
${
REPORT_DIR
}
/
${
package
##*/
}
.cov"
"
$package
"
;
done
;
# Merge the coverage profile files
echo
'mode: count'
>
"
${
REPORT_DIR
}
"
/coverage.cov
;
tail
-q
-n
+2
"
${
REPORT_DIR
}
"
/
*
.cov
>>
"
${
REPORT_DIR
}
"
/coverage.cov
;
# Display the global code coverage
go tool cover
-func
=
"
${
REPORT_DIR
}
"
/coverage.cov
;
# If needed, generate HTML report
if
[
"
$TYPE
"
==
"html"
]
;
then
go tool cover
-html
=
"
${
REPORT_DIR
}
"
/coverage.cov
-o
"
${
REPORT_DIR
}
/"
coverage.html
;
fi
rm
-rf
${
REPORT_DIR
}
"/"
*
.cov
# Remove the coverage files directory
cd
-
||
exit
1
This diff is collapsed.
Click to expand it.
devenv.nix
+
4
−
2
View file @
23dedcf0
...
...
@@ -3,8 +3,6 @@
{
env
.
LD_LIBRARY_PATH
=
lib
.
makeLibraryPath
[
];
env
.
APP_NAME
=
"bob"
;
# https://devenv.sh/packages/
...
...
@@ -81,6 +79,10 @@ else
buildDate=
''$
(version date)
fi
if [[ -z "
''$
{HOME}" ]]; then
HOME=$(pwd)
fi
${
config
.
devenv
.
root
}
/bin/go-compile.sh \
"
${
config
.
devenv
.
root
}
/source/" \
"
${
config
.
devenv
.
root
}
/dist"/ \
...
...
This diff is collapsed.
Click to expand it.
flake.nix
+
1
−
1
View file @
23dedcf0
...
...
@@ -31,7 +31,7 @@
in
{
bob
=
pkgs
.
buildGoModule
{
p
name
=
"bob"
;
name
=
"bob"
;
# In 'nix develop', we don't need a copy of the source tree
# in the Nix store.
src
=
././source
;
...
...
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