Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22fa00199
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
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22fa00199
Commits
011b8ce4
Unverified
Commit
011b8ce4
authored
2 years ago
by
maomao
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enable race check in ci (#2486)
* remove debug param * add nightly static code analysis & ut coverage
parent
fd633fb6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/build_matrixone.yml
+3
-23
3 additions, 23 deletions
.github/workflows/build_matrixone.yml
.github/workflows/robot.yml
+20
-3
20 additions, 3 deletions
.github/workflows/robot.yml
with
23 additions
and
26 deletions
.github/workflows/build_matrixone.yml
+
3
−
23
View file @
011b8ce4
...
...
@@ -39,12 +39,11 @@ jobs:
with
:
go-version
:
1.18
-
name
:
Formats
Check
-
name
:
Formats
Check
run
:
|
cd $GITHUB_WORKSPACE && make clean
if [ "$(make fmt | grep -v gofmt | wc -l)" -gt 0 ]; then exit 1; fi
-
name
:
Detect non-ascii characters
run
:
|
na_characters=$(find ${{ github.workspace }} -type f -name "*.go" -exec grep -P '[\xE5-\xE9][\x80-\xBF][\x80-\xBF]|\xE4[\xB8-\xBF][\x80-\xBF]' {} + || true)
...
...
@@ -63,30 +62,11 @@ jobs:
run
:
|
cd $GITHUB_WORKSPACE
make install-static-check-tools
make static-check &>lint.out
-
name
:
count sca failed files
run
:
|
cd $GITHUB_WORKSPACE
echo "FAILED_FILES_NUM=$(cat lint.out | grep -E '^pkg|^cmd' | awk -F ".go" '{if(NF>=2) {print $1}}' | sort -u | wc -l)" >> $GITHUB_ENV
make static-check
-
name
:
Unit Testing
timeout-minutes
:
60
run
:
|
if [[ 'schedule' == ${{ github.event_name }} ]]; then
make ut
else
make ut SKIP_TEST="race"
fi
-
name
:
calc pkg code coverage
run
:
|
cd $GITHUB_WORKSPACE
echo "CODE_COVERAGE=$(awk '{if ($3>1) covered[$1] = true; all[$1] = true} END {print length(covered) / length(all)}' profile.raw)" >> $GITHUB_ENV
-
name
:
get requested reviewers
run
:
|
echo "ASSIGNEES=${{ join(github.event.pull_request.requested_reviewers.*.login, ',') }}" >> $GITHUB_ENV
make ut
-
name
:
Build Verification Testing
run
:
|
...
...
This diff is collapsed.
Click to expand it.
.github/workflows/robot.yml
+
20
−
3
View file @
011b8ce4
...
...
@@ -57,17 +57,34 @@ jobs:
-
name
:
Unit Testing
timeout-minutes
:
60
run
:
|
make ut SKIP_TEST="race"
cd $GITHUB_WORKSPACE
test_scope=$(go list ./...)
leave_out=$(egrep -lr --include="*.go" 'Code generated by protoc-gen-gogo. DO NOT EDIT.' ./pkg/* | sort -u | xargs basename -a)
echo "INF" "Ingore code coverage $(echo ${leave_out[@]}|tr " " "|")"
ut_report="UT-Report.out"
cover_profile='profile.raw'
raw_coverage="coverage.out"
html_coverage="coverage.html"
go test -v -tags matrixone_test -p 1 -covermode=count -coverprofile=$cover_profile -coverpkg=./pkg/... $test_scope | tee ut_report
echo "ut finished"
cat $cover_profile | egrep -v $(echo ${leave_out[*]} | tr " " "|") > $raw_coverage
echo "raw_coverage finished"
go tool cover -o $html_coverage -html=$raw_coverage
echo "html_coverage finished"
rm $cover_profile
rm $raw_coverage
-
name
:
calc pkg code coverage
run
:
|
cd $GITHUB_WORKSPACE
echo "CODE_COVERAGE=$(awk '{if ($3>1) covered[$1] = true; all[$1] = true} END {print length(covered) / length(all)}' profile.raw)" >> $GITHUB_ENV
-
name
:
Archive Files
run
:
|
cd ${{ github.workspace }}
tar zcvf code_quality_reports.tar.gz coverage.html lint.out
-
name
:
Upload
id
:
uploadCoverageFile
uses
:
fjogeleit/http-request-action@v1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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