Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Parser
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
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
Anduin Xue
Parser
Commits
5ddd5a01
There was an error fetching the commit references. Please try again later.
Commit
5ddd5a01
authored
2 years ago
by
Anduin Xue
Browse files
Options
Downloads
Patches
Plain Diff
Add gitlab ci yaml.
parent
afa551d3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+89
-0
89 additions, 0 deletions
.gitlab-ci.yml
with
89 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
89
−
0
View file @
5ddd5a01
stages
:
-
Building
-
Linting
-
Testing
-
Publishing
before_script
:
-
'
export
DOTNET_CLI_TELEMETRY_OPTOUT=1'
-
'
export
PATH=$PATH:$HOME/.dotnet/tools'
-
'
dotnet
tool
install
JetBrains.ReSharper.GlobalTools
--global
||
echo
"JB
already
installed."'
-
'
dotnet
tool
install
dotnet-reportgenerator-globaltool
--global
||
echo
"DRG
already
installed."'
-
'
cat
/etc/lsb-release
&&
uname
-a
&&
pwd
&&
ls
-ashl'
-
'
echo
"Hostname:
$(hostname)"'
-
'
echo
"Uptime:
$(uptime
-p)"'
-
'
echo
"Memory:
$(free
-h
|
awk
"/^Mem:/{print
\$2}")"'
-
'
echo
"CPU
Cores:
$(nproc)"'
-
'
echo
"Available
Disk
Space:
$(df
-h
--output=avail
/
|
tail
-1)"'
-
'
echo
"IP
Address:
$(hostname
-I)"'
-
'
dotnet
--info'
restore
:
stage
:
Building
script
:
-
dotnet restore --configfile nuget.config
build
:
stage
:
Building
needs
:
-
restore
script
:
-
dotnet build --no-self-contained
lint
:
stage
:
Linting
needs
:
-
build
script
:
-
jb inspectcode ./*.sln --output=analyze_output.xml --build
-
grep 'WARNING' analyze_output.xml && cat analyze_output.xml && exit 1 || echo "No warning found"
artifacts
:
when
:
always
expire_in
:
1 day
paths
:
-
./analyze_output.xml
test
:
stage
:
Testing
needs
:
-
build
coverage
:
'
/TOTAL_COVERAGE=(\d+.\d+)/'
script
:
-
dotnet test *.sln --collect:"XPlat Code Coverage" --logger "junit;MethodFormat=Class;FailureBodyFormat=Verbose"
-
reportgenerator -reports:"**/coverage.cobertura.xml" -targetdir:"." -reporttypes:"cobertura"
-
COVERAGE_VALUE=$(grep -oPm 1 'line-rate="\K([0-9.]+)' "./Cobertura.xml")
-
COVERAGE_PERCENTAGE=$(echo "scale=2; $COVERAGE_VALUE * 100" | bc)
-
'
echo
"TOTAL_COVERAGE=$COVERAGE_PERCENTAGE%"'
artifacts
:
when
:
always
expire_in
:
1 day
paths
:
-
./**/TestResults.xml
-
./Cobertura.xml
reports
:
junit
:
-
./**/TestResults.xml
coverage_report
:
coverage_format
:
cobertura
path
:
./Cobertura.xml
publish
:
stage
:
Publishing
needs
:
-
lint
-
test
script
:
-
dotnet publish --configuration Release --runtime linux-x64 --no-self-contained *.sln
pack
:
stage
:
Publishing
needs
:
-
lint
-
test
script
:
-
dotnet build --configuration Release --no-self-contained *.sln
-
dotnet pack --configuration Release *.sln || echo "Some packaging failed!"
artifacts
:
expire_in
:
1 week
paths
:
-
'
**/*.nupkg'
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