-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
45 lines (38 loc) · 1.43 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# .NET CI for Shell runner supporting submodules
# Continuous integration for SerializationBenchmarkDotNet
variables:
GIT_SUBMODULE_STRATEGY: recursive
BENCHMARK_NAME: 'SerializationBenchmarkDotNet'
BENCHMARK_PROJECT_PATH: './$BENCHMARK_NAME/$BENCHMARK_NAME.csproj'
BENCHMARK_FOLDER: './bin/$BENCHMARK_NAME'
BENCHMARK_STORE_FOLDER: '/home/gitlab-runner/benchmarks/$BENCHMARK_NAME'
SYSTEM_TAG: 'Ubuntu VPS'
stages:
- benchmark
# Only run on benchmark branch
benchmark_job:
stage: benchmark
only:
- benchmark
script:
# Build benchmarks
- dotnet restore $BENCHMARK_PROJECT_PATH
- dotnet build $BENCHMARK_PROJECT_PATH --framework net6.0 --configuration Release --no-restore --output $BENCHMARK_FOLDER
# Run the benchmarks
- $BENCHMARK_FOLDER/$BENCHMARK_NAME
# Store running processes
- ps -aux > ./BenchmarkDotNet.Artifacts/running-processes.txt
- ps -e -o %p, -o lstart -o ,%C, -o %mem -o ,%c > ./BenchmarkDotNet.Artifacts/running-processes.csv
# Store results on server
- if [ ! -d $BENCHMARK_STORE_FOLDER ] ; then
- mkdir $BENCHMARK_STORE_FOLDER
- fi
- datetime_string=$(date +'%Y-%m-%d--%H-%M')
- targetfolder=$BENCHMARK_STORE_FOLDER/${datetime_string}--$CI_COMMIT_SHORT_SHA
- mkdir ${targetfolder}
- cp -R ./BenchmarkDotNet.Artifacts/* ${targetfolder}/
# Rename folder
- mv ./BenchmarkDotNet.Artifacts ./UbuntuVPS
artifacts:
paths:
- ./UbuntuVPS