-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
63 lines (59 loc) · 1.9 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
variables:
GIT_CLEAN_FLAGS: none # disable git clean on every stage
CODECOV_TOKEN: "064fad14-0241-4b7a-9c86-ab7b5ed067a3"
MIRROR_DIR: .mirror
GITHUB_REPO: https://github.com/yallie/MdlpClient.git
GITHUB_USER: yallie
stages:
- build
- unit tests
- mirror
build:
stage: build
before_script:
- git clean -ffdx -e $MIRROR_DIR/
script:
- dotnet build
- dotnet pack MdlpApiClient
artifacts:
paths:
- MdlpApiClient\bin\Debug\*.nupkg
unit_tests:
stage: unit tests
before_script:
- echo "Normal build -- running unit tests with coverage..."
- chcp 65001
# uncomment to install the required tools --
# dotnet tool install -g trx2junit
# choco install opencover.portable
# choco install codecov
script:
# original test command line --
# dotnet test --logger "trx;LogFileName=TestResults.trx"
# don't use -returntargetcode for now
# 'OpenCover.Console.exe -register:administrator -target:dotnet.exe -targetargs:"test --logger=trx;LogFileName=TestResults.trx" -filter:"+[*]* -[*Test*]*" -output:MdlpCoverage.xml'
# codecov -f "MdlpCoverage.xml"
- Scripts\Coverage.ps1
- TrxerConsole.exe MdlpApiClient.Tests\TestResults\TestResults.trx
- copy "MdlpApiClient.Tests\TestResults\TestResults.trx.html" "$ULTIMA_REPORT_UPLOAD_PATH\MdlpClient.html"
artifacts:
paths:
- MdlpApiClient.Tests\TestResults\TestResults.trx
- MdlpApiClient.Tests\TestResults\TestResults.xml
reports:
junit:
- MdlpApiClient.Tests\TestResults\TestResults.xml
- MdlpApiClient.Merged.Tests\TestResults\TestResultsSingleFile.xml
expire_in: 1 day
mirror:
stage: mirror
before_script:
- echo "Push changes to github mirror..."
script:
- Scripts\Mirror.ps1
-remote github
-repo $CI_REPOSITORY_URL
-dir $MIRROR_DIR
-url $GITHUB_REPO
-user $GITHUB_USER
-token $GITHUB_TOKEN